-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(tests): Test that mtime is the same after move or rename #43689
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
…erved Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
$result = copy($this->getSourcePath($source), $this->getSourcePath($target)); | ||
$sourceInternalPath = $this->getSourcePath($source); | ||
$targetInternalPath = $this->getSourcePath($target); | ||
$result = copy($sourceInternalPath, $targetInternalPath); |
Check failure
Code scanning / Psalm
TaintedFile Error
$result = copy($this->getSourcePath($source), $this->getSourcePath($target)); | ||
$sourceInternalPath = $this->getSourcePath($source); | ||
$targetInternalPath = $this->getSourcePath($target); | ||
$result = copy($sourceInternalPath, $targetInternalPath); |
Check failure
Code scanning / Psalm
TaintedFile Error
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
53a8d98
to
d37436a
Compare
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
At the moment I find it terrible! If you sync with the Windows client, the date is retained. If you add files via WebDav or upload them via the browser, the date is changed to the current date. If you copy within the NC via the browser, it is also set to the current date. If you move it in the browser, it remains the same, but only if you move it to the internal memory! If you move from an externally mounted storage (e.g. smb/cifs), it is also changed to the current date. What a mess Some want it this way, others that way. Why don't you make this variable, i.e. customisable? You could set a default via the admin settings, but users could customise this in their own settings. And you could, for example, insert a checkbox ‘Keep file date’ when copying/moving via the browser, then everyone can decide for themselves what suits them. It would then be very flexible and everyone could set it as it suits them. |
Summary
There is no clear consensus on whether copy should preserve mtime, but rename or move should definetly preserve it.
So adding some tests for this, and if failure are found I may fix some of them in the PR as well.
Checklist