~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to man/eng/fileio/mseek.xml

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
 
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
 
3
<MAN>
 
4
  <LANGUAGE>eng</LANGUAGE>
 
5
  <TITLE>mseek</TITLE>
 
6
  <TYPE>Scilab Function</TYPE>
 
7
  <DATE>April 1993</DATE>
 
8
  <SHORT_DESCRIPTION name="mseek"> set current position in binary file.  </SHORT_DESCRIPTION>
 
9
  <CALLING_SEQUENCE>
 
10
    <CALLING_SEQUENCE_ITEM>mseek(n [,fd, flag])       </CALLING_SEQUENCE_ITEM>
 
11
  </CALLING_SEQUENCE>
 
12
  <PARAM>
 
13
    <PARAM_INDENT>
 
14
      <PARAM_ITEM>
 
15
        <PARAM_NAME>n</PARAM_NAME>
 
16
        <PARAM_DESCRIPTION>
 
17
          <SP>:a positive scalar: The offset from origin in number of bytes.</SP>
 
18
        </PARAM_DESCRIPTION>
 
19
      </PARAM_ITEM>
 
20
      <PARAM_ITEM>
 
21
        <PARAM_NAME>fd</PARAM_NAME>
 
22
        <PARAM_DESCRIPTION>
 
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>
 
24
        </PARAM_DESCRIPTION>
 
25
      </PARAM_ITEM>
 
26
      <PARAM_ITEM>
 
27
        <PARAM_NAME>flag</PARAM_NAME>
 
28
        <PARAM_DESCRIPTION>
 
29
          <SP>: a string. specifies the origin. Default value 'set'.</SP>
 
30
        </PARAM_DESCRIPTION>
 
31
      </PARAM_ITEM>
 
32
    </PARAM_INDENT>
 
33
  </PARAM>
 
34
  <DESCRIPTION>
 
35
    <P>
 
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
 
46
    file.</P>
 
47
  </DESCRIPTION>
 
48
  <EXAMPLE>
 
49
<![CDATA[
 
50
file3='test3.bin'
 
51
fd1= mopen(file3,'wb');
 
52
for i=1:10, mput(i,'d'); end 
 
53
mseek(0);
 
54
mput(678,'d');
 
55
mseek(0,fd1,'end');
 
56
mput(932,'d');
 
57
mclose(fd1)
 
58
fd1= mopen(file3,'rb');
 
59
res=mget(11,'d')
 
60
res1=[1:11]; res1(1)=678;res1($)=932;
 
61
if res1<>res ;write(%io(2),'Bug');end;
 
62
mseek(0,fd1,'set');
 
63
// trying to read more than stored data 
 
64
res1=mget(100,'d',fd1);
 
65
if res1<>res ;write(%io(2),'Bug');end;
 
66
meof(fd1)
 
67
mclearerr(fd1)
 
68
mclose(fd1);
 
69
 ]]>
 
70
  </EXAMPLE>
 
71
  <SEE_ALSO>
 
72
    <SEE_ALSO_ITEM>
 
73
      <LINK>mclose</LINK>
 
74
    </SEE_ALSO_ITEM>
 
75
    <SEE_ALSO_ITEM>
 
76
      <LINK>meof</LINK>
 
77
    </SEE_ALSO_ITEM>
 
78
    <SEE_ALSO_ITEM>
 
79
      <LINK>mfprintf</LINK>
 
80
    </SEE_ALSO_ITEM>
 
81
    <SEE_ALSO_ITEM>
 
82
      <LINK>fprintfMat</LINK>
 
83
    </SEE_ALSO_ITEM>
 
84
    <SEE_ALSO_ITEM>
 
85
      <LINK>mfscanf</LINK>
 
86
    </SEE_ALSO_ITEM>
 
87
    <SEE_ALSO_ITEM>
 
88
      <LINK>fscanfMat</LINK>
 
89
    </SEE_ALSO_ITEM>
 
90
    <SEE_ALSO_ITEM>
 
91
      <LINK>mget</LINK>
 
92
    </SEE_ALSO_ITEM>
 
93
    <SEE_ALSO_ITEM>
 
94
      <LINK>mgetstr</LINK>
 
95
    </SEE_ALSO_ITEM>
 
96
    <SEE_ALSO_ITEM>
 
97
      <LINK>mopen</LINK>
 
98
    </SEE_ALSO_ITEM>
 
99
    <SEE_ALSO_ITEM>
 
100
      <LINK>mprintf</LINK>
 
101
    </SEE_ALSO_ITEM>
 
102
    <SEE_ALSO_ITEM>
 
103
      <LINK>mput</LINK>
 
104
    </SEE_ALSO_ITEM>
 
105
    <SEE_ALSO_ITEM>
 
106
      <LINK>mputstr</LINK>
 
107
    </SEE_ALSO_ITEM>
 
108
    <SEE_ALSO_ITEM>
 
109
      <LINK>mscanf</LINK>
 
110
    </SEE_ALSO_ITEM>
 
111
    <SEE_ALSO_ITEM>
 
112
      <LINK>mseek</LINK>
 
113
    </SEE_ALSO_ITEM>
 
114
    <SEE_ALSO_ITEM>
 
115
      <LINK>mtell</LINK>
 
116
    </SEE_ALSO_ITEM>
 
117
    <SEE_ALSO_ITEM>
 
118
      <LINK>mdelete</LINK>
 
119
    </SEE_ALSO_ITEM>
 
120
  </SEE_ALSO>
 
121
</MAN>