diff options
author | Stefan Hoffmann <stefan991@gmail.com> | 2014-03-16 15:01:22 +0100 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-03 10:30:03 -0300 |
commit | 071d28076f4ee057764359999cf2fabc75e99314 (patch) | |
tree | 7303724b94d7b70d60aeb2f370736ce2f6d4714f /src/os/fs.c | |
parent | 4a138137f78907703aa9215b45f46b8f37d84ae5 (diff) | |
download | rneovim-071d28076f4ee057764359999cf2fabc75e99314.tar.gz rneovim-071d28076f4ee057764359999cf2fabc75e99314.tar.bz2 rneovim-071d28076f4ee057764359999cf2fabc75e99314.zip |
move check_file_readonly() into /src/os/fs.c and rename it
Diffstat (limited to 'src/os/fs.c')
-rw-r--r-- | src/os/fs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/os/fs.c b/src/os/fs.c index 711262740e..71dee4dd3d 100644 --- a/src/os/fs.c +++ b/src/os/fs.c @@ -278,3 +278,13 @@ int os_file_exists(const char_u *name) } } +// return TRUE if a file appears to be read-only from the file permissions. +int os_file_is_readonly(const char *name) +{ + if (mch_access(name, W_OK) == 0) { + return FALSE; + } else { + return TRUE; + } +} + |