Does anyone have any ideas as to why I would be able to write but not read a file?
That’s not surprising. Consider this:
% # Create a file.
%
% touch test.txt
%
% # Give it /no/ permissions.
%
% chmod 000 test.txt
%
% # You can still see the file.
%
% ls test.txt
test.txt
%
% # But you can't read it.
%
% cat test.txt
%
% # You can, however, replace it.
%
% touch test-new.txt
% mv test-new.txt test.txt
The last step is interesting because most code that writes to a file doesn’t actually write to it. Rather, it does a ‘safe save’ operation, that writes to a temporary file and replaces the original with the temporary. That only requires write permission on the parent directory, not to the file itself.
However, this is just an example and there are many ways you can run into similar problems. File system permissions on Apple platforms are complex. I talk more about that in On File System Permissions.
I’m happy to go down this rabbit hole with you (-: To start, what platform are you on?
ps Why is your thread title “FileManager Appends Additional / in file path”? You don’t seem to mention that aspect of this issue anywhere in your question.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"