-
Notifications
You must be signed in to change notification settings - Fork 43
Copy files to destination without metadata #2
Conversation
Now it always copies even if both the source and destination are on the same partition. Not good. Can the error which occurs in |
I don't understand. |
"Move" instantly renames, "copy" takes a lot of time. |
From python docs:
|
08f134f
to
616f4ec
Compare
I see what you mean now, I missed that behavior. I have made some modifications, please review again. |
Another question is, how can I print the |
You cam use |
This is to support mounts to SAMBA shares or NTFS partitions. Those filesystems do not support file permission bitflags or other POSIX metadata. `shutil.move`, `shutil.copy2` and `shutil.copy` all copy the file *and then* attempt to do `chmod` or copy stats over. This change literally only copies the files. Permission flags are untouched. This shouldn't be a problem in theory since the destination will either not need that information *or* have inheritable permissions already properly set. Without this change, previous behavior resulted in copies properly happening but nzbget would show them as post-processing failures because the `copystat` piece was failing, if the target directory was a SAMBA share.
616f4ec
to
4944f94
Compare
Updated the code to use |
fixed: possible failure if the target directory was a SAMBA share on NTFS partition
This is to support mounts to SAMBA shares or NTFS partitions. Those
filesystems do not support file permission bitflags or other POSIX
metadata.
shutil.move
,shutil.copy2
andshutil.copy
all copy thefile and then attempt to do
chmod
or copy stats over.This change literally only copies the files. Permission flags are
untouched. This shouldn't be a problem in theory since the destination
will either not need that information or have inheritable permissions
already properly set.
Without this change, previous behavior resulted in copies properly
happening but nzbget would show them as post-processing failures
because the
copystat
piece was failing, if the target directory wasa SAMBA share.