1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
4
<LANGUAGE>eng</LANGUAGE>
6
<TYPE>Scilab Function</TYPE>
7
<DATE>April 1993</DATE>
8
<SHORT_DESCRIPTION name="mseek"> set current position in binary file. </SHORT_DESCRIPTION>
10
<CALLING_SEQUENCE_ITEM>mseek(n [,fd, flag]) </CALLING_SEQUENCE_ITEM>
15
<PARAM_NAME>n</PARAM_NAME>
17
<SP>:a positive scalar: The offset from origin in number of bytes.</SP>
21
<PARAM_NAME>fd</PARAM_NAME>
23
<SP>: scalar. The <VERB>fd</VERB> parameter returned by the function <VERB>mopen</VERB>. -1 stands for last opened file. Default value is -1.</SP>
27
<PARAM_NAME>flag</PARAM_NAME>
29
<SP>: a string. specifies the origin. Default value 'set'.</SP>
36
The function <VERB>mseek()</VERB> sets the position of the next input or output operation
37
on the stream <VERB>fd</VERB>. The new position is at
38
the signed distance given by <VERB>n</VERB> bytes from the beginning, from
39
the current position, or from the end of the file, according to the
40
<VERB>flag</VERB> value which can be <VERB>'set'</VERB>, <VERB>'cur'</VERB> or <VERB>'end'</VERB>.</P>
41
<P><VERB>mseek()</VERB> allows the file position indicator to be set beyond
42
the end of the existing data in the file. If data is later
43
written at this point, subsequent reads of data in the gap
44
will return zero until data is actually written into the
45
gap. <VERB>mseek()</VERB>, by itself, does not extend the size of the
51
fd1= mopen(file3,'wb');
52
for i=1:10, mput(i,'d'); end
58
fd1= mopen(file3,'rb');
60
res1=[1:11]; res1(1)=678;res1($)=932;
61
if res1<>res ;write(%io(2),'Bug');end;
63
// trying to read more than stored data
64
res1=mget(100,'d',fd1);
65
if res1<>res ;write(%io(2),'Bug');end;
82
<LINK>fprintfMat</LINK>
88
<LINK>fscanfMat</LINK>