xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 2e6544693d6c8f26c27166db52d0145ef320b044

Use is_dir() in utils/fs:is_dir_writable()
The code is nearly identical, so deduplicate.
Author: xaizek
Author date (UTC): 2026-11-15 13:42
Committer name: xaizek
Committer date (UTC): 2026-11-15 13:42
Parent(s): 046ec3fc1c8120f493f91560019a7b1b2d0d1d81
Signing key: 99DC5E4DB05F6BE2
Tree: 1ee6db91e5461f9e068e304e1fa650840cdd480c
File Lines added Lines deleted
src/utils/fs.c 5 9
File src/utils/fs.c changed (mode: 100644) (index d079d6aca..c669f341b)
... ... is_dir_writable(const char path[])
413 413 if(ret == ERROR_NOT_SUPPORTED || ret == ERROR_INVALID_FUNCTION || if(ret == ERROR_NOT_SUPPORTED || ret == ERROR_INVALID_FUNCTION ||
414 414 ret == ERROR_CALL_NOT_IMPLEMENTED) ret == ERROR_CALL_NOT_IMPLEMENTED)
415 415 { {
416 wchar_t *utf16_path_fb = utf8_to_utf16(path);
417 if(utf16_path_fb == NULL)
418 {
419 return 0;
420 }
421 const DWORD attrs = GetFileAttributesW(utf16_path_fb);
422 free(utf16_path_fb);
423 return attrs != INVALID_FILE_ATTRIBUTES &&
424 (attrs & FILE_ATTRIBUTE_DIRECTORY);
416 /* Another potential option to consider is trying to open directory for
417 * writing, like was done prior to the ACL checks. However, it may have
418 * problems, so it needs testing in environment where querying ACLs
419 * fails. */
420 return is_dir(path);
425 421 } }
426 422 return 0; return 0;
427 423 } }
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master