Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

device access

ebb
Beginner
622 Views
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.
0 Kudos
5 Replies
james1
Beginner
622 Views
Have you tried opening the drive with a format of 'binary'?

James
0 Kudos
Steven_L_Intel1
Employee
622 Views
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
0 Kudos
james1
Beginner
622 Views
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
0 Kudos
Steven_L_Intel1
Employee
622 Views
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
0 Kudos
ebb
Beginner
622 Views
Thanks you both for your suggestions, I'll get right on it and keep you posted.
0 Kudos
Reply