Re: Calculating file size

2008-05-01 Thread Aaron Burghardt
Yes, nice catch. Thanks, Aaron On Apr 29, 2008, at 7:56 AM, Jean-Daniel Dupas wrote: Shouldn't be !isDirectory ? if (isDirectory) { FileInfo *fileInfo = (FileInfo *) info.finderInfo; fileHFSType = [NSNumber numberWithUnsignedLong:fileInfo-fileType];

Re: Calculating file size

2008-04-29 Thread ajb . lists
I dug up some code that might help. This uses a category to replace NSFileManager's fileAttributesAtPath: traverseLink and provides more attributes than the standard implementation. With this category method, you can continue to use the directory enumerator, so your calculation becomes:

Re: Calculating file size

2008-04-28 Thread Gerriet M. Denkmann
On 28 Apr 2008, at 07:44, [EMAIL PROTECTED] wrote: Others have answered with good suggestions for other APIs, but I will point out for the record that you can do it in Cocoa, too, because the file system has a path-based mechanism in which ..namedfork/rsrc is appended to the path. For

Re: Calculating file size

2008-04-28 Thread Aaron Burghardt
On Apr 28, 2008, at 5:27 AM, Gerriet M. Denkmann wrote: This is documented in the Mac OS X system documentation. Where exactly? I have found a mention of namedfork in man RezWack and some #defines in /usr/include/sys/paths.h - but no other documentation. Kind regards, Gerriet. When I

Re: Calculating file size

2008-04-28 Thread Chris Suter
On 29/04/2008, at 2:58 AM, Aaron Burghardt wrote: When I learned of it, roughly in the timeframe of Jaguar or Panther, there was a document with a title like Mac OS X System Overview, or something similar--I think that it where I read about it. I'm sure it was documented in somewhere in

Re: Calculating file size

2008-04-27 Thread Jean-Daniel Dupas
Le 27 avr. 08 à 06:33, Jens Alfke a écrit : On 26 Apr '08, at 6:50 PM, Cocoa Dev wrote: I was wondering what was the best way to calucate folder size with cocoa? I was able to do this but it does not include resource forks: I think you'll need to drop down to a lower-level API to get the

Re: Calculating file size

2008-04-27 Thread Laurent Cerveau
On Apr 27, 2008, at 6:33 AM, Jens Alfke wrote: On 26 Apr '08, at 6:50 PM, Cocoa Dev wrote: I was wondering what was the best way to calucate folder size with cocoa? I was able to do this but it does not include resource forks: I think you'll need to drop down to a lower-level API to get

Re: Calculating file size

2008-04-27 Thread Jean-Daniel Dupas
Le 27 avr. 08 à 15:02, Laurent Cerveau a écrit : On Apr 27, 2008, at 6:33 AM, Jens Alfke wrote: On 26 Apr '08, at 6:50 PM, Cocoa Dev wrote: I was wondering what was the best way to calucate folder size with cocoa? I was able to do this but it does not include resource forks: I think

Re: Calculating file size

2008-04-27 Thread Rainer Brockerhoff
At 02:49 -0700 27/04/08, [EMAIL PROTECTED] wrote: From: Jens Alfke [EMAIL PROTECTED] References: [EMAIL PROTECTED] In-Reply-To: [EMAIL PROTECTED] Date: Sat, 26 Apr 2008 21:33:26 -0700 Message-ID: [EMAIL PROTECTED] On 26 Apr '08, at 6:50 PM, Cocoa Dev wrote: I was wondering what was the best way

Re: Calculating file size

2008-04-27 Thread ajb . lists
Others have answered with good suggestions for other APIs, but I will point out for the record that you can do it in Cocoa, too, because the file system has a path-based mechanism in which ..namedfork/rsrc is appended to the path. For example, in Terminal: $ ls -li Documents//Example.doc

Re: Calculating file size

2008-04-26 Thread Jens Alfke
On 26 Apr '08, at 6:50 PM, Cocoa Dev wrote: I was wondering what was the best way to calucate folder size with cocoa? I was able to do this but it does not include resource forks: I think you'll need to drop down to a lower-level API to get the resource fork size; probably one of the