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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -