1e6865dcdSopenharmony_ci<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 2e6865dcdSopenharmony_ci<html lang="en"> 3e6865dcdSopenharmony_ci<head> 4e6865dcdSopenharmony_ci<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5e6865dcdSopenharmony_ci<meta http-equiv="Content-Style-Type" content="text/css"> 6e6865dcdSopenharmony_ci<link rel="up" title="FatFs" href="../00index_e.html"> 7e6865dcdSopenharmony_ci<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/utime.html"> 8e6865dcdSopenharmony_ci<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default"> 9e6865dcdSopenharmony_ci<title>FatFs - f_utime</title> 10e6865dcdSopenharmony_ci</head> 11e6865dcdSopenharmony_ci 12e6865dcdSopenharmony_ci<body> 13e6865dcdSopenharmony_ci 14e6865dcdSopenharmony_ci<div class="para func"> 15e6865dcdSopenharmony_ci<h2>f_utime</h2> 16e6865dcdSopenharmony_ci<p>The f_utime function changes the timestamp of a file or sub-directory.</p> 17e6865dcdSopenharmony_ci<pre> 18e6865dcdSopenharmony_ciFRESULT f_utime ( 19e6865dcdSopenharmony_ci const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Object name */</span> 20e6865dcdSopenharmony_ci const FILINFO* <span class="arg">fno</span> <span class="c">/* [IN] Time and data to be set */</span> 21e6865dcdSopenharmony_ci); 22e6865dcdSopenharmony_ci</pre> 23e6865dcdSopenharmony_ci</div> 24e6865dcdSopenharmony_ci 25e6865dcdSopenharmony_ci<div class="para arg"> 26e6865dcdSopenharmony_ci<h4>Parameters</h4> 27e6865dcdSopenharmony_ci<dl class="par"> 28e6865dcdSopenharmony_ci<dt>path</dt> 29e6865dcdSopenharmony_ci<dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be changed.</dd> 30e6865dcdSopenharmony_ci<dt>fno</dt> 31e6865dcdSopenharmony_ci<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> 32e6865dcdSopenharmony_ci</dl> 33e6865dcdSopenharmony_ci</div> 34e6865dcdSopenharmony_ci 35e6865dcdSopenharmony_ci 36e6865dcdSopenharmony_ci<div class="para ret"> 37e6865dcdSopenharmony_ci<h4>Return Values</h4> 38e6865dcdSopenharmony_ci<p> 39e6865dcdSopenharmony_ci<a href="rc.html#ok">FR_OK</a>, 40e6865dcdSopenharmony_ci<a href="rc.html#de">FR_DISK_ERR</a>, 41e6865dcdSopenharmony_ci<a href="rc.html#ie">FR_INT_ERR</a>, 42e6865dcdSopenharmony_ci<a href="rc.html#nr">FR_NOT_READY</a>, 43e6865dcdSopenharmony_ci<a href="rc.html#ok">FR_NO_FILE</a>, 44e6865dcdSopenharmony_ci<a href="rc.html#np">FR_NO_PATH</a>, 45e6865dcdSopenharmony_ci<a href="rc.html#in">FR_INVALID_NAME</a>, 46e6865dcdSopenharmony_ci<a href="rc.html#wp">FR_WRITE_PROTECTED</a>, 47e6865dcdSopenharmony_ci<a href="rc.html#id">FR_INVALID_DRIVE</a>, 48e6865dcdSopenharmony_ci<a href="rc.html#ne">FR_NOT_ENABLED</a>, 49e6865dcdSopenharmony_ci<a href="rc.html#ns">FR_NO_FILESYSTEM</a>, 50e6865dcdSopenharmony_ci<a href="rc.html#tm">FR_TIMEOUT</a>, 51e6865dcdSopenharmony_ci<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a> 52e6865dcdSopenharmony_ci</p> 53e6865dcdSopenharmony_ci</div> 54e6865dcdSopenharmony_ci 55e6865dcdSopenharmony_ci 56e6865dcdSopenharmony_ci<div class="para desc"> 57e6865dcdSopenharmony_ci<h4>Description</h4> 58e6865dcdSopenharmony_ci<p>The <tt>f_utime</tt> function changes the timestamp of a file or sub-directory</p> 59e6865dcdSopenharmony_ci</div> 60e6865dcdSopenharmony_ci 61e6865dcdSopenharmony_ci 62e6865dcdSopenharmony_ci<div class="para use"> 63e6865dcdSopenharmony_ci<h4>Example</h4> 64e6865dcdSopenharmony_ci<pre> 65e6865dcdSopenharmony_ciFRESULT set_timestamp ( 66e6865dcdSopenharmony_ci char *obj, <span class="c">/* Pointer to the file name */</span> 67e6865dcdSopenharmony_ci int year, 68e6865dcdSopenharmony_ci int month, 69e6865dcdSopenharmony_ci int mday, 70e6865dcdSopenharmony_ci int hour, 71e6865dcdSopenharmony_ci int min, 72e6865dcdSopenharmony_ci int sec 73e6865dcdSopenharmony_ci) 74e6865dcdSopenharmony_ci{ 75e6865dcdSopenharmony_ci FILINFO fno; 76e6865dcdSopenharmony_ci 77e6865dcdSopenharmony_ci fno.fdate = (WORD)(((year - 1980) * 512U) | month * 32U | mday); 78e6865dcdSopenharmony_ci fno.ftime = (WORD)(hour * 2048U | min * 32U | sec / 2U); 79e6865dcdSopenharmony_ci 80e6865dcdSopenharmony_ci return <em>f_utime</em>(obj, &fno); 81e6865dcdSopenharmony_ci} 82e6865dcdSopenharmony_ci</pre> 83e6865dcdSopenharmony_ci</div> 84e6865dcdSopenharmony_ci 85e6865dcdSopenharmony_ci 86e6865dcdSopenharmony_ci<div class="para comp"> 87e6865dcdSopenharmony_ci<h4>QuickInfo</h4> 88e6865dcdSopenharmony_ci<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#use_chmod">FF_USE_CHMOD</a> == 1</tt>.</p> 89e6865dcdSopenharmony_ci</div> 90e6865dcdSopenharmony_ci 91e6865dcdSopenharmony_ci 92e6865dcdSopenharmony_ci<div class="para ref"> 93e6865dcdSopenharmony_ci<h4>See Also</h4> 94e6865dcdSopenharmony_ci<p><tt><a href="stat.html">f_stat</a>, <a href="sfileinfo.html">FILINFO</a></tt></p> 95e6865dcdSopenharmony_ci</div> 96e6865dcdSopenharmony_ci 97e6865dcdSopenharmony_ci<p class="foot"><a href="../00index_e.html">Return</a></p> 98e6865dcdSopenharmony_ci</body> 99e6865dcdSopenharmony_ci</html> 100