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>VFReadFile</title> 9</head> 10 11<body> 12 13<h1>VFReadFile</h1> 14 15<h2>C Specification</h2> 16<dl><dd><pre><code> 17#include <revolution/vf.h> 18 19typedef void VFFile; 20typedef s32 VFErr; 21 22VFErr VFReadFile( VFFile* file, void* buf, u32 size, u32* read_file ); 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>file</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>buf</EM></STRONG></CODE></TD> 34<TD width="520">A pointer to the storage region for reading data.</TD> 35 </tr> 36 <tr> 37<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>size</EM></STRONG></CODE></TD> 38<TD width="520">Number of bytes to read. 39 </tr> 40 <tr> 41<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>read_size</EM></STRONG></CODE></TD> 42<TD width="520">The number of read bytes (specify NULL if not needed). 43 </tr> 44</TABLE> 45</p> 46 47<h2>Return Values</h2> 48<PRE> 49Returns 0 when successful 50Otherwise, returns <code><a href="./VFErr.html">VFErr</a></code> other than 0 51</PRE> 52 53 54<H2>Description</H2> 55<p> 56Reads data from an open file. When a size that goes beyond the end of the file is specified, the read occurs up to the file's end. 57 58<br> When file data is read, the file data I/O pointer moves by the size (in bytes) that is actually read.<br> Furthermore, the I/O pointer for the read file data can be changed with <CODE>VFSeekFile</CODE>.<br> When the I/O pointer is at the end of the file, a read size of 0 is returned, indicating success.<br> An error (<CODE>VF_ERR_ENOEXEC</CODE>) is returned when the I/O pointer attempts to read from a point beyond the file's end.<br> <br><B>Note:</B> Operations cannot be guaranteed if you have specified access to an invalid region because an address check for <I><B>buf</B></I> (the pointer to the buffer) is not performed if the pointer is not a NULL pointer.<br>Data sizes larger than 4 GB cannot be read. In that case, only the first 4 GB of data will be read. 59</p> 60 61<h2>See Also</h2> 62<p> 63<code><a href="./VFCreateFile.html">VFCreateFile</a></code>, <code><a href="./VFOpenFile.html">VFOpenFile</a></code>, <code><a href="./VFSeekFile.html">VFSeekFile</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> 64</p> 65 66<H2>Revision History</H2> 67<p> 682006/06/09<br>2007/05/08 Corrected errors. 69</p> 70 71 72<hr><p>CONFIDENTIAL</p></body> 73</html> 74