-
Notifications
You must be signed in to change notification settings - Fork 365
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
LocalFileSystem
clobbers file permissions after cp_file
#1524
Comments
Am I right in remembering that this does not do atomic operations, or that it operates differently across discs? copyfile: "in the most efficient way possible" |
This really should use https://stackoverflow.com/questions/20873723/is-pythons-shutil-copyfile-atomic copyfile does not do atomic operations either so nothing will be lost. I think the issue you are worried about is the semantics if the destination path is a directory, but that can be handled with an isdir check. Alternatively, if you really want to keep
|
We would rather not add checks if possible - it turns out that things can go really slowly with bulk file operations. Would you like to propose the PR? |
This stackoverflow post gives a good behavior of what the different shutil calls do: |
Hi,
I am trying to copy a local file with the following permissions:
after copying the file it becomes:
I have narrowed the reason for this down to the cp_file function in
LocalFileSystem
whereshutil.copyfile(path1, path2)
doesn't copy the permission mode. This could be solved by using shutil.copy() and preserving the source file's permission mode.The text was updated successfully, but these errors were encountered: