Welcome, Guest. Please login or register.

Author Topic: Questions about stat() C function  (Read 1137 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline ChaosLordTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • http://totalchaoseng.dbv.pl/news.php
Questions about stat() C function
« on: February 15, 2006, 03:37:54 AM »
When my gamecode starts up it must do thousands of stat() calls on
various dirs and files to check if any files have been added or
deleted since the last program run.

For some reason every call to stat() compiled by SASC 6.58 causes an
access to a TZ Environment Variable which does not exist.  This
slows things down and makes SnoopDos print thousands of lines of
crap.

I only found out about this problem behavior due to emails from users
who complained about it.

So how do I work around this problem?


Obviously other people's programs do not trigger such yucky behavior.
For example List ALL doesn't try to repeatedly access any environment
variables for every file and dir that it lists.

> Why are you using stat() in the first place?

I want the code to be multiplatform compatible.

Does anyone have source code to the Amiga version of the stat()
function?


My SASC manual lists stat() and fstat() as UNIX.
Why is there no ANSI function that does what stat() does?
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA