Jump to content

FileRead and FileReadLine wierd behavior


Recommended Posts

Okay, this one's a little complicated. First of all, I'm using the beta, version 3.2.11.3. I'm trying to "copy" a picture file by using FileRead and FileReadLine in binary mode. I write some extra information in a file, then at a certain point I "copy" the picture file. Then when I read my file, I read the extra information using FileReadLine, and when I get to the certain point, I use FileRead to "copy" the picture file information back into a real picture file. It works great if I just use FileRead and leave out the extra information, but when I use FileReadLine and later FileRead, FileRead starts a little bit ahead of where FileReadLine left off, cutting off the beginning of the picture file information. Am I not supposed to use FileRead after FileReadLine in binary mode? I don't have a code segment that I can give you yet, but I might post one in another few hours. Thanks.

Link to comment
Share on other sites

I think this has something to do that when you use file read operation the next time you read it will start where you left off.

You can test with FileClose and then FileOpen between the read operations to reset the pointer :)

Edited by monoceres

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

I think this has something to do that when you use file read operation the next time you read it will start where you left off.

You can test with FileClose and then FileOpen between the read operations to reset the pointer :)

Actually, I'm trying to use that feature. I FileReadLine a few times, say to line 30, and when I FileRead instead of starting from the beginning of line 31, it might start reading from the middle of line 33. Thanks for the suggestion though.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...