APTrust / dart

Create bags based on BagIt profiles and send them off into the ether (EasyStore is now DART)
BSD 2-Clause "Simplified" License
46 stars 3 forks source link

Date Modified not preserved on Windows #530

Open kieranjol opened 2 years ago

kieranjol commented 2 years ago

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 commented 2 years ago

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

diamondap commented 2 years ago

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 commented 2 years ago

I can confirm the directory issue on Mac as well; and the files on windows only. Thanks for looking into this and finding that line/culprit!

K

On Thu 11 Aug 2022 at 21:23, A. Diamond @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/APTrust/dart/issues/530#issuecomment-1212457668, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAITFPQSZNDCKSSGBCROMXTVYVOKNANCNFSM56IOR3DA . You are receiving this because you authored the thread.Message ID: @.***>

diamondap commented 2 years ago

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 commented 2 years ago

Oh wow thank you! Will test asap Monday. I’ve already seen windows preserve the time stamps inside a tar when extracting so I think we should be good!!!!

On Fri 12 Aug 2022 at 20:46, A. Diamond @.***> wrote:

Version 2.0.21 preserves mod dates on files and folders. If you look inside a tarred bag using tar -tvf , 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.

— Reply to this email directly, view it on GitHub https://github.com/APTrust/dart/issues/530#issuecomment-1213459176, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAITFPXETCW6SP3DVKDVBYDVY2SXTANCNFSM56IOR3DA . You are receiving this because you authored the thread.Message ID: @.***>

kieranjol commented 2 years ago

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

kieranjol commented 2 years ago

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 commented 2 years ago

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

kieranjol commented 2 years ago

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

kieranjol commented 2 years ago

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 commented 1 month ago

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

ntallman commented 1 month ago

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 commented 1 month ago

Thanks Nathan!

K

On Fri 4 Oct 2024 at 19:59, Nathan Tallman @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/APTrust/dart/issues/530#issuecomment-2394384062, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAITFPV7CEOUGZ6QWKA7SN3ZZ3QQ3AVCNFSM6AAAAABPMFFI6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJUGM4DIMBWGI . You are receiving this because you authored the thread.Message ID: @.***>