Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does make use stat? And is that data stored in the OS?

I know this might be a stupid question.

I know that make tests for file changes based on the timestamp of a dependency and if it's newer than a target.

1) Does make use stat?

2) Information for stat is stored somewhere on the filesystem, correct?

like image 312
Alexander Kleinhans Avatar asked Oct 16 '25 08:10

Alexander Kleinhans


1 Answers

The answer to both your questions is "yes". The last modification time is an attribute of every file (and directory) and is maintained by the filesystem (it's part of the directory entry on most filesystems but that's not a requirement).

The way this data is accessed is via the stat(2) call (at least on POSIX systems; on Windows stat() exists but is a helper function translating to Windows native calls underneath).

like image 139
MadScientist Avatar answered Oct 18 '25 00:10

MadScientist



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!