1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>VFSeekFile</title>
9</head>
10
11<body>
12
13<h1>VFSeekFile</h1>
14
15<h2>C Specification</h2>
16<dl><dd><pre><code>
17#include &lt;revolution/vf.h&gt;
18
19typedef void	VFFile;
20typedef s32	VFErr;
21
22VFErr VFSeekFile( VFFile* file, s32 offset, s32 origin );
23</code></pre></dd></dl>
24
25<h2>Arguments</h2>
26<p>
27<TABLE border="1" >
28  <tr>
29<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><STRONG><EM><CODE>file</CODE></EM></STRONG></EM></STRONG></CODE></TD>
30<TD width="520">A pointer to the file descriptor.</TD>
31  </tr>
32  <tr>
33<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>offset</EM></STRONG></CODE></TD>
34<TD width="520">The number of bytes from the base point.</TD>
35  </tr>
36  <tr>
37<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>origin</EM></STRONG></CODE></TD>
38<TD width="520">The base point.<BR>
39    <TABLE border="0" >
40      <tr>
41<TD valign="top" nowrap><CODE><STRONG><EM>VF_SEEK_CUR</EM></STRONG></CODE></TD>
42<td nowrap>Current</td>
43      </tr>
44      <tr>
45<TD valign="top" nowrap><CODE><STRONG><EM>VF_SEEK_SET</EM></STRONG></CODE></TD>
46<td nowrap>Beginning</td>
47      </tr>
48      <tr>
49<TD valign="top" nowrap><CODE><STRONG><EM>VF_SEEK_END</EM></STRONG></CODE></TD>
50<td nowrap>End</td>
51      </tr>
52    </table>
53    </TD>
54  </tr>
55</TABLE>
56</p>
57
58<h2>Return Values</h2>
59<PRE>
60When successful, 0.
61When failed, a <code><a href="./VFErr.html">VFErr</a></code> other than 0.
62</PRE>
63
64
65<H2>Description</H2>
66<p>
67Moves the file data's I/O pointer. For the pointer to the file descriptor, use the one retrieved by <CODE>VFCreateFile(W)</CODE> or <CODE>VFOpenFile(W)</CODE>. Although the I/O pointer can be moved to a location beyond the end of the file (and the file size won't change until a Write occurs), an error (<CODE>VF_ERR_EINVAL</CODE>) is returned when you attempt to move the pointer ahead of the file's beginning.
68
69<br><STRONG>Note:</STRONG> When the process results in an error, the file data I/O pointer maintains the state from before fseek. The file data I/O pointer cannot be moved to a region larger than 4 GB. In this case, the file pointer is not changed from fseek's pre-issue position. When a write occurs after moving the file pointer to a region beyond the end of the file, the region between the end of the file and the file I/O pointer after the move maintains its status from before the write.<br>
70</p>
71
72<h2>See Also</h2>
73<p>
74<code><a href="./VFCreateFile.html">VFCreateFile</a></code>, <code><a href="./VFOpenFile.html">VFOpenFile</a></code>, <code><a href="./VFReadFile.html">VFReadFile</a></code>, <code><a href="./VFWriteFile.html">VFWriteFile</a></code>, <code><a href="./VFCloseFile.html">VFCloseFile</a></code>, <code><a href="./VFDeleteFile.html">VFDeleteFile</a></code>
75</p>
76
77<H2>Revision History</H2>
78<p>2006/04/26 Initial version.fc</p>
79
80
81<hr><p>CONFIDENTIAL</p></body>
82</html>
83