- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect way to handle directory read/write access checks in the test command #1116
Comments
test
command
test
command
In this case, I suggest, use these solutions from here Since there is no single and cross-platform solution, we can do it differently for different systems via There is also an option to create a file to "check" if it can be written to the directory. But this approach is IMHO error-prone |
We already have some OS-dependent logic via |
Problem Description:
The current implementation of the
TsWrite
/TsRead
case in the code does not correctly determine if a directory is writable/readable.Specifically, the following snippet:
sh/interp/test.go
Lines 158 to 163 in 86363cf
will fail when
x
refers to a directory because opening a directory with theos.O_WRONLY
flag is not a valid operation. Consequently, the function will always return false for directories, even if they are writable.The text was updated successfully, but these errors were encountered: