pyfilesystem2 icon indicating copy to clipboard operation
pyfilesystem2 copied to clipboard

Fix file move time preservation (#558)

Open mj0nez opened this issue 2 years ago • 2 comments

Type of changes

  • Bug fix

Checklist

  • [x] I've run the latest black with default args on new code.
  • [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • [x] I've added tests for new code.
  • [ ] I've updated the Documentation.
  • [x] I accept that @PyFilesystem/maintainers may be pedantic in the code review.

Description

This PR fixes a bug in the methods FS.move and MemoryFS.move, where preserve_time=True resulted in an ResourceNotFound error (see #558).

The new functions to separate copy.copy_modified_time are currently residing in copy.py. One could argue that reading and updating a files meta info are more suitable for info.py, but this would introduce further changes. Additionally, we could modify the original one to utilize both new functions. This would avoid code duplication but introduce further function calls. Opinions on this matter and reviews are welcomed!

Lastly, I would update the documentation for the new functions accordingly.

mj0nez avatar Dec 29 '22 23:12 mj0nez

@lurch, any thoughts on this draft? :)

mj0nez avatar Jan 07 '23 00:01 mj0nez

Ping

mj0nez avatar May 07 '23 14:05 mj0nez