1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-09 20:46:07 +01:00

111 lines
3.5 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="up" title="FatFs" href="../00index_j.html">
<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - f_lseek</title>
</head>
<body>
<div class="para">
<h2>f_lseek</h2>
<p><EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD>R/W<>|<7C>C<EFBFBD><43><EFBFBD>^<5E><><EFBFBD>ړ<EFBFBD><DA93><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B</p>
<pre>
FRESULT f_lseek (
FIL* <em>FileObject</em>, /* <20>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD>E<EFBFBD>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>\<5C><><EFBFBD>̂ւ̃|<7C>C<EFBFBD><43><EFBFBD>^ */
DWORD <em>Offset</em> /* <20>ړ<EFBFBD><DA93><EFBFBD><EFBFBD>I<EFBFBD>t<EFBFBD>Z<EFBFBD>b<EFBFBD>g */
);
</pre>
</div>
<div class="para">
<h4><EFBFBD><EFBFBD><EFBFBD><EFBFBD></h4>
<dl class="par">
<dt>FileObject</dt>
<dd><EFBFBD>ΏۂƂȂ<EFBFBD><EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD>E<EFBFBD>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>\<5C><><EFBFBD>̂ւ̃|<7C>C<EFBFBD><43><EFBFBD>^<5E><><EFBFBD>w<EFBFBD><EFBFBD>܂<EFBFBD><DC82>B</dd>
<dt>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EFBFBD>X<EFBFBD>N<EFBFBD>E<EFBFBD>h<EFBFBD><EFBFBD><EFBFBD>C<EFBFBD>u<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>s<EFBFBD>\<5C><><EFBFBD>ԁB</dd>
<dt>FR_INVALID_OBJECT</dt>
<dd><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȃt<EFBFBD>@<40>C<EFBFBD><43><EFBFBD>E<EFBFBD>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>B</dd>
</dl>
</div>
<div class="para">
<h4><EFBFBD><EFBFBD><EFBFBD><EFBFBD></h4>
<p><EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43>R/W<>|<7C>C<EFBFBD><43><EFBFBD>^(<28>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD>E<EFBFBD>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD>fptr<74><72><EFBFBD><EFBFBD><EFBFBD>o<EFBFBD>ŁA<C581><41><EFBFBD>ɓǂݏo<DD8F><6F><EFBFBD>E<EFBFBD><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>݂<EFBFBD><DD82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>o<EFBFBD>C<EFBFBD>g<EFBFBD>̃I<CC83>t<EFBFBD>Z<EFBFBD>b<EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD>ړ<EFBFBD><DA93><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B<EFBFBD>I<EFBFBD>t<EFBFBD>Z<EFBFBD>b<EFBFBD>g<EFBFBD>̌<EFBFBD><CC8C>_<EFBFBD>̓t<CD83>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><E693AA><EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD><C582>B<EFBFBD><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>݃<EFBFBD><DD83>[<5B>h<EFBFBD>Ńt<C583>@<40>C<EFBFBD><43><EFBFBD>E<EFBFBD>T<EFBFBD>C<EFBFBD>Y<EFBFBD><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȓl<C892><6C><EFBFBD>w<EFBFBD><EFBFBD><E882B7><EFBFBD>ƁA<C681><41><EFBFBD><EFBFBD><EFBFBD>܂Ńt<C583>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EA82BD><EFBFBD><EFBFBD><EFBFBD>̃f<CC83>[<5B>^<5E>͖<EFBFBD><CD96><EFBFBD><EFBFBD>`<60>ƂȂ<C682><C882>܂<EFBFBD><DC82>B<EFBFBD>f<EFBFBD>[<5B>^<5E><><EFBFBD>x<EFBFBD><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɏ<EFBFBD><C98F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>݂<EFBFBD><DD82><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>́A<CD81>\<5C>߂<EFBFBD><DF82>̊֐<CC8A><D690>ŕK<C595>v<EFBFBD>ȃT<C883>C<EFBFBD>Y<EFBFBD>܂Ńt<C583>@<40>C<EFBFBD><43><EFBFBD>E<EFBFBD>T<EFBFBD>C<EFBFBD>Y<EFBFBD><59><EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482><EFBFBD><EFBFBD>Ɨǂ<C697><C782>ł<EFBFBD><C582><EFBFBD>Bf_lseek<65>֐<EFBFBD><D690><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>I<EFBFBD><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ́A<CD81>t<EFBFBD>@<40>C<EFBFBD><43>R/W<>|<7C>C<EFBFBD><43><EFBFBD>^<5E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ړ<EFBFBD><DA93><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>fptr<74><72><EFBFBD>`<60>F<EFBFBD>b<EFBFBD>N<EFBFBD><4E><EFBFBD><EFBFBD><EFBFBD>ׂ<EFBFBD><D782>ł<EFBFBD><C582>B<EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43>R/W<>|<7C>C<EFBFBD><43><EFBFBD>^<5E><><EFBFBD>w<EFBFBD><77><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E88FAC><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>́A<CD81><41><EFBFBD>̌<EFBFBD><CC8C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B</p>
<ul>
<li><EFBFBD>񏑂<EFBFBD><EFBFBD><EFBFBD><EFBFBD>݃<EFBFBD><EFBFBD>[<5B>h<EFBFBD>̂<EFBFBD><CC82>߁A<DF81>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD>E<EFBFBD>T<EFBFBD>C<EFBFBD>Y<EFBFBD>ŃN<C583><4E><EFBFBD>b<EFBFBD>v<EFBFBD><76><EFBFBD><EFBFBD>B</li>
<li><EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD>Ƀf<C983>B<EFBFBD>X<EFBFBD>N<EFBFBD><4E><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>ɂȂ<C982><C882><EFBFBD><EFBFBD>B</li>
</ul>
</div>
<div class="para">
<h4><EFBFBD>Ή<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></h4>
<p><tt>_FS_MINIMIZE &lt; 3</tt><EFBFBD>̂Ƃ<EFBFBD><EFBFBD>g<EFBFBD>p<EFBFBD>”\<5C>ł<EFBFBD><C582>B</p>
</div>
<div class="para">
<h4><EFBFBD>g<EFBFBD>p<EFBFBD><EFBFBD></h4>
<pre>
// <20>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD>E<EFBFBD>I<EFBFBD>t<EFBFBD>Z<EFBFBD>b<EFBFBD>g5000<30>ֈړ<D688>
res = f_lseek(&amp;file, 5000);
// <20>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD>NjL<C78B>̏<EFBFBD><CC8F><EFBFBD> (<28>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD>I<EFBFBD>[<5B>ֈړ<D688>)
res = f_lseek(&amp;file, file.fsize);
// 3000<30>o<EFBFBD>C<EFBFBD>g<EFBFBD>i<EFBFBD>߂<EFBFBD>
res = f_lseek(&amp;file, file.fptr + 3000);
// 2000<30>o<EFBFBD>C<EFBFBD>g<EFBFBD>߂<EFBFBD> (<28>I<EFBFBD>[<5B>o<EFBFBD>[<5B>t<EFBFBD><74><EFBFBD>[<5B>ɒ<EFBFBD><C992><EFBFBD>)
res = f_lseek(&amp;file, file.fptr - 2000);
</pre>
<pre>
// <20>N<EFBFBD><4E><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>s<EFBFBD><73><EFBFBD><EFBFBD><E89396> (<28>X<EFBFBD>g<EFBFBD><67><EFBFBD>[<5B>~<7E><><EFBFBD>O<EFBFBD>E<EFBFBD><45><EFBFBD>C<EFBFBD>g<EFBFBD><67><EFBFBD>̃o<CC83>b<EFBFBD>t<EFBFBD>@<40>E<EFBFBD>I<EFBFBD>[<5B>o<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD>h<EFBFBD>~)
res = f_open(&amp;file, "record.wav", FA_CREATE_NEW | FA_WRITE); // <20>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD>
res = f_lseek(&amp;file, MAX_SIZE); // <20>\<5C><><EFBFBD>ȃN<C883><4E><EFBFBD>X<EFBFBD>^<5E>̐<EFBFBD><CC90>s<EFBFBD><73><EFBFBD><EFBFBD><E89396>
if (res || file.fptr != PRE_SIZE) .... // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EA82BD><EFBFBD>`<60>F<EFBFBD>b<EFBFBD>N
res = f_lseek(&amp;file, DATA_START); // <20>f<EFBFBD>[<5B>^<5E>E<EFBFBD>X<EFBFBD>g<EFBFBD><67><EFBFBD>[<5B><><EFBFBD>̋L<CC8B>^(<28>A<EFBFBD><41><EFBFBD>P<EFBFBD>[<5B>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD>f<EFBFBD>B<EFBFBD><42><EFBFBD>C<EFBFBD><43><EFBFBD><EFBFBD>)
...
res = f_truncate(&amp;file); // <20>s<EFBFBD>v<EFBFBD>̈<EFBFBD><CC88>̐؂<CC90><D882>̂<EFBFBD>
res = f_lseek(&amp;file, 0); // <20>w<EFBFBD>b<EFBFBD>_<EFBFBD>̋L<CC8B>^
...
res = f_close(&amp;file);
</pre>
</div>
<div class="para">
<h4><EFBFBD>Q<EFBFBD><EFBFBD></h4>
<p><tt><a href="open.html">f_open</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
<p class="foot"><a href="../00index_j.html"><EFBFBD>߂<EFBFBD></a></p>
</body>
</html>