PDA

View Full Version : please help with maxscript <binstream>


bloodlocust
07-02-2002, 12:45 AM
Hi there,

I'm using "fseek myfile pos 1". Basically I want to seek from the beginning of the file, using my offset "pos".

The docs do not make it clear how to use fseek.

Do I: "fseek pos 1" or "fseek pos #seek_set" ? bit confused as if I actually have to type #seek_set? or is it asking for a number between 1 and 3?


Docs:
Boolean fseek <BinStream> <Integer> <#seek_set | #seek_cur | #seek_end>

Move the file pointer to the specified location based off the seek parameter.

#seek_set - base off start of file.

#seek_cur - base off current position.

#seek_end - base off end of file.




Thanks for any help you may have.

ofer_z
07-02-2002, 01:34 PM
the integer in fseek is an offset relative to:
#seek_set - the begininng of the file.
#seek_cur - the current position in the file.
#seek_end - the end of the file.

so, in your case you need:

myfile = fopen "c:\\myfile.txt"
fseek myfile 0 #seek_set



hOpe this helps,
o

bloodlocust
07-03-2002, 12:42 AM
Thanks for the help! :)

CGTalk Moderation
01-13-2006, 09:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.