From 3b504e7c8d20bb41ef6b6f95e46527766438046a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 30 Jun 2019 16:00:35 +0200 Subject: fileio.c: eliminate set_file_time() #10357 Introduce os_file_settime(), remove cruft. --- src/nvim/os/fs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/nvim/os/fs.c') diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index d5500b230c..1ecca87cde 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -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. -- cgit