PageRenderTime 22ms CodeModel.GetById 15ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/wbudowane/mp3-wave/pff2/doc/pf/read.html

http://momus-projects.googlecode.com/
HTML | 73 lines | 62 code | 11 blank | 0 comment | 0 complexity | af9df31869f7b54e9494f11ab9b1aaea MD5 | raw file
 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2<html lang="en">
 3<head>
 4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 5<meta http-equiv="Content-Style-Type" content="text/css">
 6<link rel="up" title="Petit FatFs" href="../00index_p.html">
 7<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
 8<link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
 9<title>Petit FatFs - pf_read</title>
10</head>
11
12<body>
13
14<div class="para">
15<h2>pf_read</h2>
16<p>The pf_read function reads data from the file.</p>
17<pre>
18FRESULT pf_read (
19  void* <em>Buffer</em>,       /* Pointer to the read buffer */
20  WORD <em>ByteToRead</em>,    /* Number of bytes to read */
21  WORD* <em>BytesRead</em>     /* Pointer to the variable to return number of bytes read */
22);
23</pre>
24</div>
25
26<div class="para">
27<h4>Parameters</h4>
28<dl class="par">
29<dt>Buffer</dt>
30<dd>Pointer to the buffer to store the read data. A NULL specifies the destination is an outgoing stream.</dd>
31<dt>ByteToRead</dt>
32<dd>Number of bytes to read.</dd>
33<dt>BytesRead</dt>
34<dd>Pointer to the WORD variable to return number of bytes read.</dd>
35</dl>
36</div>
37
38
39<div class="para">
40<h4>Return Values</h4>
41<dl class="ret">
42<dt>FR_OK (0)</dt>
43<dd>The function succeeded.</dd>
44<dt>FR_DISK_ERR</dt>
45<dd>The function failed due to an error in the disk function, a wrong FAT structure or an internal error.</dd>
46<dt>FR_NOT_OPENED</dt>
47<dd>The file has not been opened.</dd>
48<dt>FR_NOT_ENABLED</dt>
49<dd>The volume has not been mounted.</dd>
50</dl>
51</div>
52
53
54<div class="para">
55<h4>Description</h4>
56<p>The read pointer in the file system object increases in number of bytes read. After the function succeeded, <tt>*BytesRead</tt> should be checked to detect end of file. In case of <tt>*BytesRead &lt; ByteToRead</tt>, it means the read pointer reached end of file during read operation.</p>
57<p>If a NULL is given to the Buffer, the read bytes will be forwarded to the outgoing stream instead of the memory. The streaming function will be typically built-in the low level disk read function.</p>
58</div>
59
60<div class="para">
61<h4>QuickInfo</h4>
62<p>Available when <tt>_USE_READ == 1</tt>.</p>
63</div>
64
65
66<div class="para">
67<h4>References</h4>
68<p><tt><a href="open.html">pf_open</a>, <a href="write.html">pf_write</a>, <a href="sfatfs.html">FATFS</a></tt></p>
69</div>
70
71<p class="foot"><a href="../00index_p.html">Return</a></p>
72</body>
73</html>