Copy process - check target for write access before enum.
Moderators: Hacker, petermad, Stefan2, white
Copy process - check target for write access before enum.
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.
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.
- ghisler(Author)
- Site Admin
- Posts: 50873
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
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.
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.
2MVV
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.Every folder's ACL may deny writing regardless of volume information.