Skip to content
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

Date Modified not preserved on Windows #530

Open
kieranjol opened this issue Aug 11, 2022 · 13 comments
Open

Date Modified not preserved on Windows #530

kieranjol opened this issue Aug 11, 2022 · 13 comments

Comments

@kieranjol
Copy link

I've noticed that when making a regular bag, or a tarred bag on Windows 10 - the Date modified dates are not preserved, and instead the dates refer to the datetime of bagging.
I've not noticed this issue on Mac when using Dart.

I just tested regular bagit-python on Windows and it preserves date modified dates.

@diamondap
Copy link
Member

Looking into this. It appears to affect directory entries only on all platforms.

@diamondap
Copy link
Member

The problem is here: https://github.com/APTrust/dart/blob/master/plugins/formats/write/tar_writer.js#L110

We need to use stats from original source directory.

Attempted one fix today, which was unsuccessful. It may be a while before I can get to this.

@kieranjol
Copy link
Author

kieranjol commented Aug 11, 2022 via email

@diamondap
Copy link
Member

Version 2.0.21 preserves mod dates on files and folders. If you look inside a tarred bag using tar -tvf <bagname.tar>, you'll see the correct timestamps on all items in the data directory. I'm not sure whether Windows preserves those when it untars the files and writes them to a new directory, but they are preserved correctly in the bag.

@kieranjol
Copy link
Author

kieranjol commented Aug 13, 2022 via email

@kieranjol
Copy link
Author

I can confirm that the date modified issue is no longer present on windows.

@kieranjol
Copy link
Author

To clarify - when using TAR, date modified of files are preserved. If TAR is not used, then date modified becomes current time. Is this expected?

@diamondap
Copy link
Member

diamondap commented Aug 15, 2022

I don't think that behavior should be expected. For bagging, we try to preserve file attributes.

@diamondap diamondap reopened this Aug 15, 2022
@kieranjol
Copy link
Author

kieranjol commented Aug 15, 2022

If that is the case, regular bagging using DART (no tar) does not preserve date modified values on Mac (12.5) and Windows.

@kieranjol
Copy link
Author

For what it's worth - I bagged and tarred seperately two partitions that were on one physical drive(NTFS and FAT32). When untarred with -zxcf, both files and folders retained their date modified values. So this is wonderful!

@jtruitt1
Copy link

jtruitt1 commented Oct 4, 2024

I've also encountered this issue, running DART v. 2.0.22 on a Mac

@ntallman
Copy link
Member

ntallman commented Oct 4, 2024

I've noted this on an internal ticket. DART 2.x development isn't likely to continue as we try to focus on a DART 3 alpha. release. But we still should verify DART 3 preserves file dates in bag it produces, serialized or otherwise.

@kieranjol
Copy link
Author

kieranjol commented Oct 4, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants