fileio.c: eliminate set_file_time() #10357

Introduce os_file_settime(), remove cruft.
This commit is contained in:
Justin M. Keyes
2019-06-30 16:00:35 +02:00
committed by GitHub
parent fdd8dcae01
commit 3b504e7c8d
4 changed files with 22 additions and 48 deletions

View File

@@ -746,6 +746,22 @@ bool os_path_exists(const char_u *path)
return os_stat((char *)path, &statbuf) == kLibuvSuccess;
}
/// Sets file access and modification times.
///
/// @see POSIX utime(2)
///
/// @param path File path.
/// @param atime Last access time.
/// @param mtime Last modification time.
///
/// @return 0 on success, or negative error code.
int os_file_settime(const char *path, double atime, double mtime)
{
int r;
RUN_UV_FS_FUNC(r, uv_fs_utime, path, atime, mtime, NULL);
return r;
}
/// Check if a file is readable.
///
/// @return true if `name` is readable, otherwise false.