Cymric wrote:
ChaosLord wrote:
I am already using stat() but the problem is that stat() in SASC triggers a read of a nonexistent environment variable TZ which is lame and slow. I am doing thousands of stat() in a loop.
Either that, or change to a different c.lib, or use the #define-method, or write your own stat()-code which gets linked before c.lib. The last method is probably the best solution, as your portable fallthrough solution would be limited to one maintainable place in your code.
Okey dokey so I can make my own stat() function
that uses AmigaOS way of doing things that will fill in
a unix struct stat so all the time compare code will work without change.
BUT... how do I convert from AmigaDOS time format to Unix time_t format?
Accessing an environment variable for no reason every time you check the existence of a file sounds like something linux would do. :insane: So that is why I was searching for a cleaner way that is also multiplatform.
Since TZ is 'time zone', I am not at all impressed by this line of reasoning. That people do not use time zones and instead just force the clock of their computer to the right time is not SAS/C's fault---instead, it is following proper Unix programming guidelines.
But the timezone of my computer has nothing to do with the
time that some file was created many years ago on someone elses computer... Does it?
I guess you are saying that linux constantly converts all filedates to/from GMT?
So all filedates in linux are stored on the HD in GMT?
And since AmigaOS does
not store filedates in GMT but
instead stores the
actual date where it was created,
the stat() function in SASC should be rewritten
to NOT check TZ since adding in the user's TimeZone
under AmigaOS would then give the
wrong date.
Correct?