rewind a file

I want to rewind a file to the beginning.  Is there a command equivalent to the rewind command in C for VB.  If not, without closing the file and opening it again, how would one do this?
LJ083198Asked:
Who is Participating?
 
mark2150Commented:
If the records are fixed length and you know the record number you can use the SEEK command to reposition the pointer in the file without having to close & reopen. Will be *MUCH* faster esp if disk file can be cached.
0
 
steve06Commented:
LJ,

What you could do is to open the file with the mode "Binary" (Open FileName.txt for Binary ), and then use the command Get to restart from the beginning of the file.

BTW, I don't see what's wrong with closing a file and reopening it right away ...

Steve.
0
 
LJ083198Author Commented:
Because I have to bounce each record in the file off of this other file and there are 2,000 records.  It seems to take longer when i close and reopen for each record.
0
 
mark2150Commented:
BTW: SEEK to 0 will rewind the file if you need to do a sequential search.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.