mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
added doxygen documentation for os_file_is_{readonly, writable}
This commit is contained in:
parent
fa2b327e9a
commit
db92e0b094
@ -278,7 +278,6 @@ 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 (access(name, W_OK) == 0) {
|
||||
@ -288,8 +287,6 @@ int os_file_is_readonly(const char *name)
|
||||
}
|
||||
}
|
||||
|
||||
// return 0 for not writable, 1 for writable file, 2 for a dir which we have
|
||||
// rights to write into.
|
||||
int os_file_is_writable(const char *name)
|
||||
{
|
||||
if (access(name, W_OK) == 0) {
|
||||
|
14
src/os/os.h
14
src/os/os.h
@ -60,6 +60,18 @@ int os_setperm(const char_u *name, int perm);
|
||||
/// @return `TRUE` if `name` exists.
|
||||
int os_file_exists(const char_u *name);
|
||||
|
||||
/// Check if a file is readonly.
|
||||
///
|
||||
/// @return `True` if `name` is readonly.
|
||||
int os_file_is_readonly(const char *name);
|
||||
|
||||
/// Check if a file is writable.
|
||||
///
|
||||
/// @return `0` if `name` is not writable,
|
||||
/// @return `1` if `name` is writable,
|
||||
/// @return `2` for a directory which we have rights to write into.
|
||||
int os_file_is_writable(const char *name);
|
||||
|
||||
long_u os_total_mem(int special);
|
||||
const char *os_getenv(const char *name);
|
||||
int os_setenv(const char *name, const char *value, int overwrite);
|
||||
@ -68,7 +80,5 @@ int os_get_usernames(garray_T *usernames);
|
||||
int os_get_user_name(char *s, size_t len);
|
||||
int os_get_uname(uid_t uid, char *s, size_t len);
|
||||
char *os_get_user_directory(const char *name);
|
||||
int os_file_is_readonly(const char *name);
|
||||
int os_file_is_writable(const char *name);
|
||||
|
||||
#endif // NEOVIM_OS_OS_H
|
||||
|
Loading…
Reference in New Issue
Block a user