Lazarus

Programming => Operating Systems => Linux => Topic started by: pascalbythree on October 12, 2021, 12:55:05 pm

Title: Get the file creation time and date under Raspbian Linux.
Post by: pascalbythree on October 12, 2021, 12:55:05 pm
Hey does anybody know how to read the file creation date and time from a file to a TDateTime ?

Maybe i need the file change date later on.

On linux.

It is ment to poll in a loop to see if a .hex file is changed and then start avrdude with the filename.

also when its overwritten.

PS: i did try some default functions, but does not seem to be sufficiant
Title: Re: Get the file creation time and date under Raspbian Linux.
Post by: MarkMLl on October 12, 2021, 01:15:12 pm
Look up fpStat() and fpFStat() in BaseUnix.

MarkMLl
Title: Re: Get the file creation time and date under Raspbian Linux.
Post by: Kays on October 12, 2021, 02:12:47 pm
It is ment to poll in a loop to see if a .hex file is changed and then start avrdude with the filename.
The clean solution would be use inotify(7) (https://man7.org/linux/man-pages/man7/inotify.7.html). See also a demo in the wiki (https://wiki.freepascal.org/inotify).
Title: Re: Get the file creation time and date under Raspbian Linux.
Post by: pascalbythree on October 12, 2021, 02:39:21 pm
It got to work! thank you all for the help so far!

Now i am going to work on starting the fpc exe on automatic login prompt. in SH.
Title: Re: Get the file creation time and date under Raspbian Linux.
Post by: MarkMLl on October 12, 2021, 02:57:54 pm
It got to work! thank you all for the help so far!

Now i am going to work on starting the fpc exe on automatic login prompt. in SH.

Watch it: you're not running SH and almost certainly aren't running sh either :-)

Different shells use different startup scripts at different times: you're probably running either Bash or Dash so /probably/ need to look at ~/.bashrc

MarkMLl
TinyPortal © 2005-2018