• 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
RE: Help needed with low-level device access
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Help needed with low-level device access


  • Subject: RE: Help needed with low-level device access
  • From: "David Hazel" <email@hidden>
  • Date: Fri, 17 Nov 2006 18:00:02 -0000
  • Importance: Normal

Title: RE: Help needed with low-level device access
Thanks for answering that, Quinn. With your and Dan's help, I've resolved the corruption problem that I was having. However, the remains an odd problem with the remounting process, which maybe someone out there can help me with.
 
I have two pieces of functionality that do the write operations I was describing. One of them works perfectly (unmounts the device, writes to it and remounts it). The other gives an error when it tries to remount the device at the end of the write operation. Both pieces of code call one method to unmount the device and open it for write access, and another method to close it and remount it. In both cases, the remount is being given the same (correct) driveID, but one call works every time whereas the other consistently fails with one of two errno values (9 = Bad file descriptor, or 2 = No such file or directory).
 
Can anyone suggest what might be causing this error? I have spent most of the afternoon looking for possible initialisation problems or other significant differences between the two functions, but I can find none. The only think I can think of that might be relevant is that the function that fails also has another (normal) file open for read access while it is writing to the device. I have tried closing that other file before closing the device, and I have tried closing the device first, but neither way around makes any difference.
 
Any ideas?
 
 
Regards,
David Hazel
 
-----Original Message-----
From: filesystem-dev-bounces+david.hazel=email@hidden [mailto:filesystem-dev-bounces+david.hazel=email@hidden]On Behalf Of Quinn
Sent: 17 November 2006 09:36
To: email@hidden
Subject: RE: Help needed with low-level device access

At 9:18 +0000 17/11/06, David Hazel wrote:
How do I unmount a device without ejecting it?

The easiest way is to use the File Manager routine FSUnmountVolumeSync.  This also has an asynchronous variant (FSUnmountVolumeAsync).  These routines are implemented in terms of the DiskArbitration framework, which you can also call directly (DADiskUnmount).

S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >RE: Help needed with low-level device access (From: Quinn <email@hidden>)

  • Prev by Date: RE: Help needed with low-level device access
  • Next by Date: Encrypted Storage on WebDAV
  • Previous by thread: RE: Help needed with low-level device access
  • Next by thread: Encrypted Storage on WebDAV
  • Index(es):
    • Date
    • Thread