alexcrichton / filetime

Accessing file timestamps in a platform-agnostic fashion in Rust
Apache License 2.0
122 stars 56 forks source link

Fix PermissionDenied error with Windows folders #54

Closed ilai-deutel closed 4 years ago

ilai-deutel commented 4 years ago

Currently, a PermissionDenied error is raised when using set_file_times, set_file_mtime, set_file_atime or set_symlink_file_times and passing a path to a folder on Windows. Passing the FILE_FLAG_BACKUP_SEMANTICS flag when opening the file handle fixes the issue.

This PR also adds tests for setting directory times.

alexcrichton commented 4 years ago

Thanks!

ilai-deutel commented 4 years ago

Thank you for merging this quickly. Do you have plans for a patch release that would include this fix? I think that dbrgn/tealdeer#115 depends on this

alexcrichton commented 4 years ago

Sure thing, published now!