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.
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.
p.s. what the heck is the difference between stat() and lstat() ? :huh:
On the Amiga, not really important, if memory serves me. The calls return different results when fed a file or a link, either hard or soft. One gives the results for the link itself, the other follows it through to the file pointed at. Links never worked properly under FFS. Or they did, but then only the softlink. Or was it the hardlink?