filesize

How to limit file size on commit?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 18:41:53
问题 I'm fully aware of this question which technically makes this a duplicate but the answers only offer a solution on push , which would be too late for my requirements. Is there an option to limit the file size when committing? For example: file sizes above 500K would produce a warning. File sizes above 10M would stop the commit. 回答1: This pre-commit hook will do the file size check: .git/hooks/pre-commit #!/bin/sh hard_limit=$(git config hooks.filesizehardlimit) soft_limit=$(git config hooks

Way to reduce size of .ttf fonts?

安稳与你 提交于 2019-12-17 18:03:55
问题 Is there any way to reduce the size of the .ttf fonts? i.e. if we want to remove some glyps which we are not using. 回答1: With Google Web Fonts, you can limit the character set like: //fonts.googleapis.com/css?family=FontName&text=Lorem%20Ipsum This would be particularly useful if Google had icon fonts like Font Awesome 回答2: You can use fontforge to reduce the file size This is explained at http://www.cnx-software.com/2010/02/19/reducing-truetype-font-file-size-for-embedded-systems/ 回答3:

Find size of git repo

心已入冬 提交于 2019-12-17 15:00:27
问题 What's a simple way to find the size of my git repository? And I don't mean du -h on the root directory of my repo. I have a lot of ignored files so that size would be different from my total repo size. I essentially want to know how much data would be transfered upon cloning my repo. 回答1: UPDATE git 1.8.3 introduced a more efficient way to get a rough size: git count-objects -vH (see answer by @VonC) For different ideas of "complete size" you could use: git bundle create tmp.bundle --all du

PHP post_max_size overrides upload_max_filesize

好久不见. 提交于 2019-12-17 04:25:28
问题 In my site host, I have seen (via phpinfo) that post_max_size = 8Mb upload_max_filesize = 16Mb This led me to think that I should be able to upload as file as big as 16Mb. However, when I do this through a post method (as normal), post_max_size takes over and declares that I sent too much. What is the method which permits sending a file as big as 16Mb ? GET - PUT - other ? Hope someone can clarify this for me. Simon 回答1: upload_max_filesize is the limit of any single file. post_max_size is

How can I check the size of a file in a Windows batch script?

会有一股神秘感。 提交于 2019-12-17 04:22:38
问题 I want to have a batch file which checks what the filesize is of a file. If it is bigger than %somany% kbytes, it should redirect with GOTO to somewhere else. Example: [check for filesize] IF %file% [filesize thing Bigger than] GOTO No echo Great! Your filesize is smaller than %somany% kbytes. pause exit :no echo Um... You have a big filesize. pause exit 回答1: If the file name is used as a parameter to the batch file, all you need is %~z1 (1 means first parameter) If the file name is not a

PHP x86 How to get filesize of > 2 GB file without external program?

人盡茶涼 提交于 2019-12-17 03:36:57
问题 I need to get the file size of a file over 2 GB in size. (testing on 4.6 GB file). Is there any way to do this without an external program? Current status: filesize() , stat() and fseek() fails fread() and feof() works There is a possibility to get the file size by reading the file content (extremely slow!). $size = (float) 0; $chunksize = 1024 * 1024; while (!feof($fp)) { fread($fp, $chunksize); $size += (float) $chunksize; } return $size; I know how to get it on 64-bit platforms (using

PHP x86 How to get filesize of > 2 GB file without external program?

99封情书 提交于 2019-12-17 03:36:29
问题 I need to get the file size of a file over 2 GB in size. (testing on 4.6 GB file). Is there any way to do this without an external program? Current status: filesize() , stat() and fseek() fails fread() and feof() works There is a possibility to get the file size by reading the file content (extremely slow!). $size = (float) 0; $chunksize = 1024 * 1024; while (!feof($fp)) { fread($fp, $chunksize); $size += (float) $chunksize; } return $size; I know how to get it on 64-bit platforms (using

Get size of file on disk

℡╲_俬逩灬. 提交于 2019-12-17 03:31:12
问题 var length = new System.IO.FileInfo(path).Length; This gives the logical size of the file, not the size on the disk. I wish to get the size of a file on the disk in C# (preferably without interop ) as would be reported by Windows Explorer. It should give the correct size, including for: A compressed file A sparse file A fragmented file 回答1: This uses GetCompressedFileSize, as ho1 suggested, as well as GetDiskFreeSpace, as PaulStack suggested, it does, however, use P/Invoke. I have tested it

java get file size efficiently

陌路散爱 提交于 2019-12-17 01:39:51
问题 While googling, I see that using java.io.File#length() can be slow. FileChannel has a size() method that is available as well. Is there an efficient way in java to get the file size? 回答1: Well, I tried to measure it up with the code below: For runs = 1 and iterations = 1 the URL method is fastest most times followed by channel. I run this with some pause fresh about 10 times. So for one time access, using the URL is the fastest way I can think of: LENGTH sum: 10626, per Iteration: 10626.0

Size vs Size On Disk

痴心易碎 提交于 2019-12-16 18:03:28
问题 I read about the byte vs cluster theory, but I don't think it can apply in my case; Doesn't seem to have to do with "a bunch of small files"; . ├── [ 11K] 2ndVisit_Checklist.xlsx ├── [ 35K] 2ndVisit FTS_Timetable.xlsx ├── [ 34K] 2ndVisit_Roomlist.pdf ├── [ 27K] 2ndVisit_Teilnehmer.xlsx ├── [9.5K] Belgian Pupils for European Parliament.xlsx ├── [4.0K] Brussel EU │ ├── [ 64K] Checkliste.doc │ ├── [144K] Plan A73.doc │ ├── [ 38K] TN Liste EP.docx │ └── [108K] TN Liste EP V02.doc ├── [ 12K]