Page 1 of 1

Copy process - check target for write access before enum.

Posted: 2015-02-12, 15:46 UTC
by Lefteous
When trying to copy a large amount of data - especially a large amount of files the current copy process enumerates the target files first and then attempts to copy the files to the target folder. If the target folder isn't writable for a reason which cannot be solved immediately (in the corresponing error dialog) there is no other way but to cancel the whole process.

Suggestion: Before starting lengthy enumerations on the source data structure perform a basic write access check on the target folder. Only continue if it suceeds.

Posted: 2015-02-12, 15:58 UTC
by MVV
It would be perfect to have background enumeration... Disabling enumeration makes copying/moving visually endless, but for deletion counting isn't required at all. In case of errors (like mentioned one) counting useless too. So background counting would solve all problems with boring waitings.

Posted: 2015-02-12, 22:00 UTC
by Hacker
MVV,
Perhaps there is potential for a significant speedup by using the Everything library.

Roman

Posted: 2015-02-13, 07:13 UTC
by MVV
However it is still important to be able to do this in background.

Posted: 2015-02-16, 11:02 UTC
by ghisler(Author)
You can't really check this without actually trying to create a file. Enumerating the source while already copying files is a bad idea, at least for harddisks, because it causes a lot of disk head movements between the directories and the currently copied file.

Posted: 2015-02-16, 12:18 UTC
by Lefteous
Yes it's not about speed. It's about the order. Please check first if files can be copied. I think checking general volume properties (FILE_READ_ONLY_VOLUME in GetVolumeInformation) and checking permissions should be enough.

Posted: 2015-02-16, 12:40 UTC
by MVV
Lefteous,
Every folder's ACL may deny writing regardless of volume information.

ghisler,
OS should be able to manage such simultaneous requests so it shouldn't be a problem (e.g. it may use caching and sequence I/O requests in order to reduce head movements). Enumerating itself already causes a lot of disk head movements regardless of parallel disk I/O operations so there won't be much differences.

Posted: 2015-02-16, 12:47 UTC
by Lefteous
2MVV
Every folder's ACL may deny writing regardless of volume information.
Okay let's try again. Read volume information first. If the volume information says the whole volume is read-only --> abort copying. If the volume is not read-only try reading the targets' permissions. On NTFS this are ACLs for other file systems there might be other mechanisms. If the ACLs clearly state that there is no way to copy the target --> ask the user what to do --> ask for elevation, abort, etc. If elevation succeeds start copying.