]> cloudbase.mooo.com Git - z180-stamp.git/blame - fatfs/doc/en/sync.html
Import fatfs R0.12b
[z180-stamp.git] / fatfs / doc / en / sync.html
CommitLineData
53668523
L
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
2<html lang="en">\r
3<head>\r
4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
5<meta http-equiv="Content-Style-Type" content="text/css">\r
6<link rel="up" title="FatFs" href="../00index_e.html">\r
7<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sync.html">\r
8<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">\r
9<title>FatFs - f_sync</title>\r
10</head>\r
11\r
12<body>\r
13\r
14<div class="para func">\r
15<h2>f_sync</h2>\r
16<p>The f_sync function flushes the cached information of a writing file.</p>\r
17<pre>\r
18FRESULT f_sync (\r
19 FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>\r
20);\r
21</pre>\r
22</div>\r
23\r
24<div class="para arg">\r
25<h4>Parameter</h4>\r
26<dl class="par">\r
27<dt>fp</dt>\r
28<dd>Pointer to the open file object to be flushed.</dd>\r
29</dl>\r
30</div>\r
31\r
32\r
33<div class="para ret">\r
34<h4>Return Values</h4>\r
35<p>\r
36<a href="rc.html#ok">FR_OK</a>,\r
37<a href="rc.html#de">FR_DISK_ERR</a>,\r
38<a href="rc.html#ie">FR_INT_ERR</a>,\r
53668523
L
39<a href="rc.html#io">FR_INVALID_OBJECT</a>,\r
40<a href="rc.html#tm">FR_TIMEOUT</a>\r
41</p>\r
42</div>\r
43\r
44\r
45<div class="para desc">\r
46<h4>Description</h4>\r
70702af1
L
47<p>The <tt>f_sync</tt> function performs the same process as <tt>f_close</tt> function but the file is left opened and can continue read/write/seek operations to the file. This is suitable for the applications that open files for a long time in write mode, such as data logger. Performing <tt>f_sync</tt> function of periodic or immediataly after <tt>f_write</tt> function can minimize the risk of data loss due to a sudden blackout or an unintentional media removal. For more information, refer to <a href="appnote.html#critical">application note</a>.</p>\r
48<p>However there is no sense in <tt>f_sync</tt> function immediataly before <tt>f_close</tt> function because it performs <tt>f_sync</tt> function in it. In other words, the differnce between those functions is that the file object is invalidated or not.</p>\r
53668523
L
49</div>\r
50\r
51\r
52<div class="para comp">\r
53<h4>QuickInfo</h4>\r
54<p>Available when <tt>_FS_READONLY == 0</tt>.</p>\r
55</div>\r
56\r
57\r
58<div class="para ref">\r
59<h4>See Also</h4>\r
60<p><tt><a href="close.html">f_close</a></tt></p>\r
61</div>\r
62\r
63<p class="foot"><a href="../00index_e.html">Return</a></p>\r
64</body>\r
65</html>\r