filesize

Get each file size inside a Folder using SQL

扶醉桌前 提交于 2019-12-10 13:49:28
问题 We are keeping images in Folder which can have images & sub folder & these sub folders can also have images & sub folders for example c:\myImageFolder\image1.png //'myImageFolder' have image c:\myImageFolder\Folder1\imagex.png // 'myImageFolder' have another folder inside which is 'Folder1'. c:\myImageFolder\Folder1\ChildFolder1\imagen.png // 'myImageFolder' have 'Folder1' which have 'ChildFolder1' which have imagen.png We need to know that how many images are in there over 1 MB, over 750KB

How to create a file of size more than 2GB in Linux/Unix?

半腔热情 提交于 2019-12-10 13:04:40
问题 I have this home work where I have to transfer a very big file from one source to multiple machines using bittorrent kinda of algorithm. Initially I am cutting the files in to chunks and I transfer chunks to all the targets. Targets have the intelligence to share the chunks they have with other targets. It works fine. I wanted to transfer a 4GB file so I tarred four 1GB files. It didn't error out when I created the 4GB tar file but at the other end while assembling all the chunks back to the

Image resize results in massively larger file size than original C#

断了今生、忘了曾经 提交于 2019-12-10 11:41:16
问题 I've been using this method to resize uploaded .JPG images to a max width, but it's resulting in images being larger in kb than the source. What am I doing wrong? Is there something else I need to do when saving the new image? I've tried all sorts of combinations of PixelFormat , e.g. PixelFormat.Format16bppRgb555 E.g: source image is a .JPG 1900w, trying to resize to 1200w... - Source file is 563KB, - resized file is 926KB or larger, even 1.9MB public static void ResizeToMaxWidth(string

os.path.getsize reports a filesize with an L at the end, why?

耗尽温柔 提交于 2019-12-10 02:16:10
问题 import os, sys def crawlLocalDirectories(directoryToCrawl): crawledDirectory = [os.path.join(path, subname) for path, dirnames, filenames in os.walk(directoryToCrawl) for subname in dirnames + filenames] return crawledDirectory print crawlLocalDirectories('.') dictionarySize = {} def getSizeOfFiles(filesToMeasure): for everyFile in filesToMeasure: size = os.path.getsize(everyFile) dictionarySize[everyFile] = size return dictionarySize print getSizeOfFiles(crawlLocalDirectories('.')) Whenever

BitmapFactory.decodeStream() returns a Bitmap ~100 times more than original

五迷三道 提交于 2019-12-09 23:57:59
问题 I have a PNG image of 168.2KB and 1991x1756 and tried to import it into a Bitmap using BitmapFactory.decodeStream() . The problem is that I run into OutOfMemoryError where the Bitmap size ends up being 13,657KB. What I don't understand is why is the file so big after the import and how to mitigate this. Seems that this OutOfMemoryError issue is very common with decoded Bitmap images but can't find a way to fix it. Any ideas? Bitmap bitmap = BitmapFactory.decodeStream(inputStream, null,

filesize from a String

限于喜欢 提交于 2019-12-09 04:39:39
问题 how can i get the "filesize" from a string in php? I put the string in a mysql database as a blob and i need to store the size of the blob. My solution was to create a temp file and put the string into the temp file. now i can get the filesize from the "string". but that solution is not good... greetings 回答1: It depends. If you have mbstring function overloading enabled, the only call that will work will be mb_strlen($string, '8bit'); . If it's not enabled, strlen($string) will work fine as

Recursively getting the size of a directory

。_饼干妹妹 提交于 2019-12-08 19:10:56
问题 Is there a good gem for getting recursively calculated directory sizes? In unix, I can use du , but I want a library that absorbs the difference among OS. 回答1: Looks like sys-filesystem handles this, but you'll need to do some math to convert the available blocks into bytes (by multiplying by block-size). 回答2: This seems to work: Dir.glob(File.join(dir, '**', '*')) .map{ |f| File.size(f) } .inject(:+) 回答3: Could something like this work for you? def directory_size(path) path << '/' unless

Portable way to get file size in C/C++

别来无恙 提交于 2019-12-08 16:37:43
问题 I need to determin the byte size of a file. The coding language is C++ and the code should work with Linux, windows and any other operating system. This implies using standard C or C++ functions/classes. This trivial need has apparently no trivial solution. 回答1: Using std's stream you can use: std::ifstream ifile(....); ifile.seekg(0, std::ios_base::end);//seek to end //now get current position as length of file ifile.tellg(); If you deal with write only file (std::ofstream), then methods are

Autoit - Get the file size of all files in path

為{幸葍}努か 提交于 2019-12-08 13:52:53
问题 Im using a script to get all files and dirs in a specific and generates a .txt file of the result but i need to add the size of each file using the FileGetSize + ByteSuffix functions #include <File.au3> #include <WinAPIFiles.au3> Global Enum Step *2 $GETFILES_NOT_DIRECTORY, $GETFILES_NOT_EXISTS ; GetFiles @error Func G3tAllF1lesAndDirs($cpath, $txtname) Local $sFileList = '' GetFiles($sFileList, $cpath) ; This uses no global variable $sFileList = StringReplace($sFileList, '|', @CRLF) ;

Apache doesn't show filesize/duration during downloading .dmg in browser?

♀尐吖头ヾ 提交于 2019-12-08 05:22:37
问题 I have a .dmg on my website for a Mac Software, but when i try to download this (even in different browsers), it doesn't show me the duration or the filesize. Could this be something i need to configure in Apache? I checked the http header: HTTP/1.1 200 OK => Date => Mon, 22 Apr 2013 15:36:08 GMT Server => Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.3.22 Last-Modified => Thu, 11 Apr 2013 13:30:19 GMT ETag => "2087eb-4151ab7-4da15c9a450c0" Accept-Ranges => bytes