File Attributes, Unix Tools and memory usage
File Attributes, Unix Tools and memory usage
- Subject: File Attributes, Unix Tools and memory usage
- From: Matt Ronge <email@hidden>
- Date: Sat, 09 Feb 2002 18:12:52 -0600
Hello,
I'm working on laying down the schematics for an application I'm going to
write that will work very closely with files and their attributes.
I started writing out what I want as instance variables in a class called
File. File is going to be a kind of wrapper for my application, it's going
to provide services from NSFileWrapper and NSFileManager in one class.
Now speed is of course going to be an issue for my application and my way of
thinking is that I should cache file attribues in instance variables and
then explicitly refresh them when I need to. However after writing out the
instance variables I am going to need I realized there will be alot of them.
So from here I have a number of choices and I was hoping someone with more
OS X experience then myself could help me out: keep them all and use up more
memory, keep only the most commonly used attributes in memory, or keep none
of them in memory and do I/O when needed.
Here is my current setup of instance variables:
NSImage *icon
NSString *name
NSString *path
NSString *fileType
NSString *ownerAccountName
NSString *groupOwnerAccountName
NSNumber *creatorCode
NSNumber *typeCode
NSNumber *posixPermissions
NSNumber *extensionHidden
NSNumber *fileSize
NSNumber *referenceCount
NSNumber *deviceIdentifier
NSNumber *fileSystemNumber
NSNumber *systemFileNumber
NSDate *modificationDate
BOOL readable
BOOL executable
BOOL deletable
BOOL writable
BOOL exists
Will I run into a memory issue if I have 100 of these in a NSMutableArray?
Sorry for my ignorance on this, I thought I'd before I find myself in a
hole.
Also, I want to display other POSIX attribues (I won't be caching them
because not many people will want to look at them) like immutable and append
flags. As far as I can see there is no high level API to grab this
information besides the standard UNIX tools. I read that I should assume
that the user might not install the BSD tools, will I run into this issue
with these attributes? If I use a BSD API and bypass reading data from a
command line tool I might be OK, will I?
Thanks for the help, and sorry about my UNIX and Cocoa ignorance
--
Matt Ronge
President
Monkeybread Software
http://www.monkeybreadsoftware.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.