flash - FLEX: getting a folder size -


i'm triying folder size doing:

var folderfile:file = new file("file:///somepath/folder"); var foldersize: folderfile.size; 

but gives me value of 0, how can folder size? there anyway this?

tranks

no, there's no way automagically. getting size of directory complex , potentially painfully slow operation. there 10s of thousands of files in directory, or directory located on (slow?) network, not mention tape storage , similar scenarios.

the file systems don't store directory size information, , way know calculate file-by-file, there's no quick/easy shortcut. so, have rely on solution posted above, and, yes, going slow.


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -