snoyberg / tar-conduit

Conduit based tar extraction mechanism
MIT License
8 stars 9 forks source link

Set modification time before file mode on Windows #25

Closed gaborh-da closed 5 years ago

gaborh-da commented 5 years ago

If one sets the file mode first, then a read only file's modification time cannot be set.

lehins commented 5 years ago

@gaborh-da you are totally right, we need to update that behavior on unix as well. I mistakenly thought updating attributes will update the mtime, but it only updates ctime. I'll merge the PR a bit later, change the behavior on Unix and do a release later on today.

gaborh-da commented 5 years ago

@lehins I am not sure it needs update on Unix. I tried the following scenario:

  1. touched a file
  2. chmod 400 on that file which should be read only
  3. then, chmod 555 and it still worked