RE: Help needed with low-level device access
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
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