This commit is contained in:
Christopher Williams
2025-06-23 16:37:39 -07:00
parent ff60b17ea7
commit 79eff96e0b
18 changed files with 460 additions and 327 deletions
+7 -5
View File
@@ -15,7 +15,7 @@
<pre>
FRESULT f_utime (
const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Object name */</span>
const FILINFO* <span class="arg">fno</span> <span class="c">/* [IN] Time and data to be set */</span>
const FILINFO* <span class="arg">fno</span> <span class="c">/* [IN] Time and date to be set */</span>
);
</pre>
</div>
@@ -26,7 +26,7 @@ FRESULT f_utime (
<dt>path</dt>
<dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be changed. If a null pointer is given, the function fails with <tt>FR_INVALID_DRIVE</tt>.</dd>
<dt>fno</dt>
<dd>Pointer to the file information structure that has a timestamp to be set in member fdate and ftime. Do not care any other members.</dd>
<dd>Pointer to the file information structure that has new timestamps to be set in the members. <tt>fdate</tt> and <tt>ftime</tt> are for the last modified time. When <tt><a href="config.html#fs_ctime">FF_FS_CRTIME</a> = 1</tt>, <tt>crdate</tt> and <tt>crtime</tt> for the created time are available in addition. Every timestamp is in local time. If <tt>fdate</tt> or <tt>crdate</tt> is invalid (0), the modified time or created time is left unchanged respectively. Do not care any other member.</dd>
</dl>
</div>
@@ -61,7 +61,7 @@ FRESULT f_utime (
<h4>Example</h4>
<pre>
FRESULT set_timestamp (
char *obj, <span class="c">/* Pointer to the file name */</span>
const char *fname, <span class="c">/* Pointer to the file name */</span>
int year,
int month,
int mday,
@@ -74,8 +74,10 @@ FRESULT set_timestamp (
fno.fdate = (WORD)(((year - 1980) * 512U) | month * 32U | mday);
fno.ftime = (WORD)(hour * 2048U | min * 32U | sec / 2U);
return <em>f_utime</em>(obj, &amp;fno);
<span class="k">#if</span> FF_FS_CRTIME
fno.crdate = 0; <span class="c">/* Do not change created time in this code */</span>
<span class="k">#endif</span>
return <em>f_utime</em>(fname, &amp;fno);
}
</pre>
</div>