Le 27/02/2013 à 01:22, Shane Stanley < email@hidden> a écrit : On 27/02/2013, at 12:25 AM, koenig.yvan <email@hidden> wrote:
I forgot that ASObjC Runner is able to return the true size of a folder. Finder and System Events return the value missing only.
Maybe I'm missing something, but a quick check with a package here gets the size OK with both Finder and SE. Is it just a problem with larger directories?
Once I thought to the shell command ls but this one returns the physical size, not the total count of bytes.
Are you sure about that? If I use ls with a Pages package, and add up all except the actual folder sizes, I get the same as in Get Info.
I re-ran the script used yesterdays and got different results. I can't work with a tool which returns missing value from time to time and the correct one at other times.
The script : set paquet to "Macintosh HD:Users:yvankoenig:Desktop:Léo Ferré CDs.pages:"
tell application "System Events" activate size of disk item paquet end tell
tell application "Finder" size of item paquet end tell
quoted form of POSIX path of paquet do shell script "ls -@lh " & result
tell application "ASObjC Runner" set fileInfo to about file paquet include only "size" with directory size end tell
The log report :
tell application "System Events" activate get size of disk item "Macintosh HD:Users:yvankoenig:Desktop:Léo Ferré CDs.pages:" --> 2013900 end tell tell application "Finder" get size of item "Macintosh HD:Users:yvankoenig:Desktop:Léo Ferré CDs.pages:" --> 2013900 end tell tell current application do shell script "ls -@lh '/Users/yvankoenig/Desktop/Léo Ferré CDs.pages/'" --> "total 3816 -rw-r--r-- 1 yvankoenig staff 1.7M Feb 26 14:12 104_0469 2.JPG -rw-r--r-- 2 yvankoenig staff 64K Feb 20 22:13 2013-02-20T22.06.10.png drwxr-xr-x 3 yvankoenig staff 102B Feb 26 14:13 Contents drwxr-xr-x 3 yvankoenig staff 102B Feb 26 14:13 QuickLook -rw-r--r-- 1 yvankoenig staff 355B Feb 26 14:13 buildVersionHistory.plist -rw-r--r-- 1 yvankoenig staff 78K Feb 26 14:13 index.xml.gz" end tell tell application "ASObjC Runner" about file "Macintosh HD:Users:yvankoenig:Desktop:Léo Ferré CDs.pages:" include only "size" with directory size --> {name:"Léo Ferré CDs.pages", size:2013900} end tell
The package contents :
104_0469 2.JPG >> 1794516 bytes 2013-02-20T22.06.10.png >> 65540 bytes buildVersionHistory.plist >> 355 bytes Contents > PkgInfo >> 8 bytes index.xml.gz >> 79415 bytes QuickLook > Thumbnail.jpg >> 74066 bytes
Yvan KOENIG (VALLAURIS, France) mercredi 27 février 2013 10:04:00
|