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

touchfile does not update modification time #102

Open
sol opened this issue Jun 12, 2015 · 9 comments
Open

touchfile does not update modification time #102

sol opened this issue Jun 12, 2015 · 9 comments

Comments

@sol
Copy link

sol commented Jun 12, 2015

(this is at least true on Linux x64)

@gregwebs
Copy link
Owner

Right now it is using

Data.Text.IO.appendFile file ""

I could see how something along the way could end up optimizing this to a no-op. Better would be to use a real touch command, do you know what that is?

@sol
Copy link
Author

sol commented Jun 12, 2015

Not efficient, but good enough for testing purpose: https://github.com/hspec/mockery/pull/4/files

Also, @Fuuzetsu mentioned there will be a way to set modification times with the next version of directory.

@gregwebs
Copy link
Owner

Not efficient, but good enough for testing purpose: https://github.com/hspec/mockery/pull/4/files

yikes! we can't do that!

Also, @Fuuzetsu mentioned there will be a way to set modification times with the next version of directory

Shelly can upgrade to it, but it will need to use CPP to continue to support older versions of directory.

@damiencourousse
Copy link

I have just stumbled on this issue as well, also on Linux x64.
Any update?

@gregwebs
Copy link
Owner

@damiencourousse do you know a good API for touching a file in Haskell?

@damiencourousse
Copy link

damiencourousse commented Jun 29, 2019

@damiencourousse do you know a good API for touching a file in Haskell?

No, I'm sorry. But I have seen that Turtle uses touchFile from module System.Posix for all OSes but mingw32_HOST_OS:
https://hackage.haskell.org/package/turtle-1.2.5/docs/src/Turtle-Prelude.html#touch

@andreasabel
Copy link
Collaborator

andreasabel commented Jun 9, 2020

Does not work on Mac OS X either.
Seems to be known on stackoverflow: https://stackoverflow.com/a/50298141/1817682.
(I am actually looking for an OS-oblivious version of touch in Haskell. Maybe if I skip Win32, the previous answer is sufficient.)

Could touchfile just call touchFile from unix-compat?
https://hackage.haskell.org/package/unix-compat-0.5.2/docs/System-PosixCompat-Files.html#v:touchFile
There seems to be a disclaimer, though:

NOTE: the portable implementations are not well tested, in some cases
functions are only stubs.

@gregwebs
Copy link
Owner

gregwebs commented Jun 9, 2020

want to send a pull request to fix it?

@andreasabel
Copy link
Collaborator

That would probably not be too hard.
But I am afraid of breaking things; the CI isn't up to speed: I reported #191.
Getting the CI running again is maybe the highest priority. After that, folks could more confidently submit PRs. Friendly contributors have set this up Github CI Actions for Agda: https://github.com/agda/agda/actions. This test compilation on version 8.0-8.10 of GHC and on the three major OSs.

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