2

I need to determine what has changed in the file system.

How can I a get the time when a file was last modified?

1 Answer 1

3

The modification time of a file will always be returned by file-or-directory-modify-seconds. This will also return the modification date of directories except from the FAT format file systems - for directories a FAT file system will return the creation date instead.

To convert the file modification time, or any time in seconds to a more readable format you can use seconds->date.

> (require racket/date) ;for date->string only > (date->string (seconds->date (file-or-directory-modify-seconds (string->path "/home/ben/.emacs")))) "Wednesday, June 4th, 2014" 

reference: racket discussion list

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.