- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to read the sectors from a floppy device (or any device)
starting at sector 0 with CVF? I've tried many OPEN variations with
no success.
starting at sector 0 with CVF? I've tried many OPEN variations with
no success.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried opening the drive with a format of 'binary'?
James
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hmm, I'm skeptical that that would work. If it did, it would require NT/2000/XP and administrator privilege and a filename of the form .PHYSICALDRIVEn, where "n" is a zero-based number for the drive. The killer here is that there is a restriction that the I/O buffer be sector-aligned, which the CVF run-time library doesn't do.
You'd be better off to call the Win32 CreateFile and ReadFile directly. See the documentation for CreateFile.
Steve
You'd be better off to call the Win32 CreateFile and ReadFile directly. See the documentation for CreateFile.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, I don't see how calling CreateFile and ReadFile would differ in this case. It seems like this was what that format was provided to do. If you do reads using a buffer equivalent to the sector size, then I would expect the underlying ReadFile to remain in alignment.
James
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The run-time library is going to read into its own buffer, not your variable. The RTL's buffer isn't going to be "sector aligned" (which is device-dependent.)
It's easy enough to use CreateFile and ReadFile from CVF.
Steve
It's easy enough to use CreateFile and ReadFile from CVF.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks you both for your suggestions, I'll get right on it and keep you posted.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page