Copy process - check target for write access before enum.

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Copy process - check target for write access before enum.

Post 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.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post 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.
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

MVV,
Perhaps there is potential for a significant speedup by using the Everything library.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

However it is still important to be able to do this in background.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post 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.
Author of Total Commander
https://www.ghisler.com
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post 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.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post 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.
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post 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.
Post Reply