-
July 20th, 2011, 11:48 AM
#1
Filestream.Seek + floppy drive
Hi, what i'm trying to do is to access floppy drive and read some data. To do this i'm using CreateFile p/invoke with filename "\\\\.\\A:" (that's because Filestream.Open doesn't support floppy device reading) and Filestream.Read with handle parameter returned from CreateFile. Everything works perfect except when i try to seek position using Filestream.Seek, it returns with IOException - invalid parameter. I've tried with p/invoke SetFilePointer from win32 but it returns with the same error (ERROR_INVALID_PARAMETER). Funny thing is that the same function works in pure c++ code... Does anyone know why this is happening and how to fix this?
-
July 21st, 2011, 01:44 AM
#2
Re: Filestream.Seek + floppy drive
Odd... Then I have not had use for a floppy drive for many years now. I think I would consider reading the entire file into memory and do the seek in memory instead.
Always use [code][/code] tags when posting code.
-
July 21st, 2011, 03:36 AM
#3
Re: Filestream.Seek + floppy drive
Yeah it seems it is the only way to bypass this bug...
-
July 23rd, 2011, 12:11 AM
#4
Re: Filestream.Seek + floppy drive
Originally Posted by Marduk
Yeah it seems it is the only way to bypass this bug...
Better performance reading it into memory rather than hitting the floppy drive too...
Best Regards,
BioPhysEngr
http://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|