use older stat tools. TurboC doesn't know what S_ISDIR is
Some checks failed
Build / build (push) Failing after 32s
Some checks failed
Build / build (push) Failing after 32s
This commit is contained in:
parent
602f941dd3
commit
b54f0119fc
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,4 +2,5 @@
|
||||
.grok/
|
||||
.idea/
|
||||
.vscode/
|
||||
.DS_Store
|
||||
build/
|
||||
|
||||
@ -11,8 +11,8 @@ int ensure_directory_exists(const char *path) {
|
||||
struct stat st;
|
||||
|
||||
if (stat(path, &st) == 0) {
|
||||
/* Path exists, check if it's a directory */
|
||||
if (S_ISDIR(st.st_mode)) {
|
||||
/* Path exists, check if it's a directory using bit test */
|
||||
if ((st.st_mode & S_IFMT) == S_IFDIR) {
|
||||
return 1;
|
||||
} else {
|
||||
fprintf(stderr, "Error: %s exists but is not a directory\n", path);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user