• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Followup: Disk images and Fast User Switching...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Followup: Disk images and Fast User Switching...


  • Subject: Followup: Disk images and Fast User Switching...
  • From: Pat Homelvig <email@hidden>
  • Date: Fri, 27 May 2005 12:20:12 -0600

I just verified that the problem lies on the files residing on a mounted disk image.

If I reference files stored on the root file system, everything works correctly.

Suggestions on how we should mount the disk image???

Pat


Begin forwarded message:
For a prototype that we are doing, we are mounting a disk image in the /private/tmp directory, and then trying to programmatically open a file in the mounted disk image from another user.  We are finding that the file is not opened.

We are mounting the disk image with the following script:

#!/bin/sh
/usr/bin/hdiutil attach -readwrite -owners off -mountroot /tmp /Path/To/Disk/Image.dmg
chmod 777 /tmp/Image

Then we are attempting to open the file programmatically with the following:


            BOOL value = [[NSWorkspace sharedWorkspace] openFile:[resource valueForKey:@"path"]];

Where [resource valueForKey:@"path"] returns the full path to a file that exists in the mounted disk image:

i.e.

/tmp/Image/some/subdirectory/image.tif

The above command returns YES, and everything works fine, if this is done with the same user that mounted the disk image (executed the above script).  From Terminal, you can also execute the following:

open /tmp/Image/some/subdirectory/image.tif

And you can also traverse the path to the file in finder, and double-click to open it.

However if you do the above from a different user, the openFile: command still returns YES, and the default app becomes active (in this case, it is Preview), but the file is never opened.

Executing the "open" command from a terminal gets the same result.

Double clicking on the file in finder also gets the same result.

Even dropping the image onto a running Preview's icon doesn't open it.

However in Finder, when you have the file selected, the image shows up.

And executing the File->Open menu in Preview, and selecting the file DOES open the image.

Once I have opened the file with Preview, all of the above commands now work.

This tells me that the file is valid, and the second user does have permission to open the file.

Any suggestions?  Code wise, or mounting the disk image wise to fix this?

Hopefully someone will have a clue.

Pat


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: IB Instances
  • Next by Date: Apple guys: is the XCode generated CD accessor code decent?
  • Previous by thread: RE: Making custom looks for controls
  • Next by thread: Apple guys: is the XCode generated CD accessor code decent?
  • Index(es):
    • Date
    • Thread