+\r
+\r
+\r
+/*-----------------------------------------------------------------------*/\r
+/* Change Timestamp */\r
+/*-----------------------------------------------------------------------*/\r
+\r
+FRESULT f_utime (\r
+ const TCHAR* path, /* Pointer to the file/directory name */\r
+ const FILINFO* fno /* Pointer to the time stamp to be set */\r
+)\r
+{\r
+ FRESULT res;\r
+ DIR dj;\r
+ BYTE *dir;\r
+ DEF_NAMEBUF;\r
+\r
+\r
+ /* Get logical drive number */\r
+ res = find_volume(&dj.fs, &path, 1);\r
+ if (res == FR_OK) {\r
+ INIT_BUF(dj);\r
+ res = follow_path(&dj, path); /* Follow the file path */\r
+ FREE_BUF();\r
+ if (_FS_RPATH && res == FR_OK && (dj.fn[NSFLAG] & NS_DOT))\r
+ res = FR_INVALID_NAME;\r
+ if (res == FR_OK) {\r
+ dir = dj.dir;\r
+ if (!dir) { /* Root directory */\r
+ res = FR_INVALID_NAME;\r
+ } else { /* File or sub-directory */\r
+ ST_WORD(dir+DIR_WrtTime, fno->ftime);\r
+ ST_WORD(dir+DIR_WrtDate, fno->fdate);\r
+ dj.fs->wflag = 1;\r
+ res = sync_fs(dj.fs);\r
+ }\r
+ }\r
+ }\r
+\r
+ LEAVE_FF(dj.fs, res);\r
+}\r
+\r