On Tue, Dec 23, 2008 at 6:01 AM, Doug <[email protected]> wrote:
>
> I have built a Union File System using Objective C and the read only
> file system template for XCode - mostly by copying code from the
> loopback file system. I have it working except I do not have a clue
> as to how to process command line arguments in ObjectiveC/Cocoa.
If you wanted a command line file system, then you should have used
the "Objective-C Command Line File System" template :-)
That produces a main.m that has an example of how to do command line
arguments. As a bonus, it is set up to copy the file system's volume
icon to the resource fork of the resulting binary, so that when it
mounts you even get a nice looking volume icon.
If you look in the main.m from that template you will also see a line
that looks like:
// [options addObject:@"rdonly"]; <-- Uncomment to mount read-only.
Uncomment that and your file system is mounted read only. You'll also
want to change the part of the code that allocates your file system so
that you can pass in arguments based on your command line parsing.
Let me know if this doesn't solve your problem...
ted
>
> My main (provided by the xcode template for macfuse) looks like this:
>
> #import <Cocoa/Cocoa.h>
>
> int main(int argc, char *argv[])
> {
> return NSApplicationMain(argc, (const char **) argv);
> }
>
> argv contains a number of directories that need to be passed into the
> files system implementation provided by the xcode template (this one:)
>
> @interface unionfs_Filesystem : NSObject {
> NSArray *paths; //the paths that go in the array, in the order they
> will be searched.
> }
>
> From what code do I add the paths into the unionfs_Filesystem object?
> Currently, I just hard code them in the init function for unionfs.
>
> - (id)init {
> if ((self = [super init])) {
> paths = [NSArray arrayWithObjects:
> @"/Users/doug/junk/a",@"/Users/
> doug/junk/b",nil];
> return self;
> }
> return nil;
> }
>
>
>
>
>
>
> Doug Ransom
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MacFUSE" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/macfuse?hl=en
-~----------~----~----~----~------~----~------~--~---