FatFS/doc/ja/write.html
savelij13 5fa1073a5a fatfs v0.08b Jan 15,2011:
- Fast seek feature is also applied to f_read() and f_write().
- f_lseek() reports required table size on creating CLMP.
- Extended format syntax of f_printf function.
- Ignores duplicated directory separators in given path names.
2025-09-11 09:45:45 +03:00

76 lines
2.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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="alternate" hreflang="en" title="English" href="../en/write.html">
<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - f_write</title>
</head>
<body>
<div class="para func">
<h2>f_write</h2>
<p>ファイルにデータを書き込みます。</p>
<pre>
FRESULT f_write (
FIL* <em>FileObject</em>, <span class="c">/* ファイル・オブジェクト */</span>
const void* <em>Buffer</em>, <span class="c">/* 書き込みデータ */</span>
UINT <em>ByteToWrite</em>, <span class="c">/* 書き込むバイト数 */</span>
UINT* <em>ByteWritten</em> <span class="c">/* 書き込まれたバイト数 */</span>
);
</pre>
</div>
<div class="para arg">
<h4>引数</h4>
<dl class="par">
<dt>FileObject</dt>
<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
<dt>Buffer</dt>
<dd>書き込むデータを格納したバッファを指すポインタを指定します。</dd>
<dt>ByteToWrite</dt>
<dd>書き込むバイト数(0UINTの最大値)を指定します。</dd>
<dt>ByteWritten</dt>
<dd>書き込まれたバイト数を格納する変数を指すポインタを指定します。戻り値は関数の成否にかかわらず常に有効です。</dd>
</dl>
</div>
<div class="para ret">
<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
<a href="rc.html#ie">FR_INT_ERR</a>,
<a href="rc.html#nr">FR_NOT_READY</a>,
<a href="rc.html#de">FR_DENIED</a>,
<a href="rc.html#io">FR_INVALID_OBJECT</a>,
<a href="rc.html#tm">FR_TIMEOUT</a>
</p>
</div>
<div class="para desc">
<h4>解説</h4>
<p>書き込み開始位置は、リード/ライト・ポインタの位置からになります。リード/ライト・ポインタは実際に書き込まれたバイト数だけ進みます。関数が正常終了した後、要求したバイト数が書き込まれたかどうか<tt>*ByteWritten</tt>をチェックすべきです。<tt>*ByteWritten &lt; ByteToWrite</tt>のときは、ディスク・フルを意味します。ディスク・フルが発生しているときまたはそれに近いときは、制御が帰るまで時間がかかる場合があります。</p>
</div>
<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>のときに使用可能です。</p>
</div>
<div class="para ref">
<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">fputc</a>, <a href="puts.html">fputs</a>, <a href="printf.html">fprintf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>