TIP: Click on subject to list as thread! ANSI
echo: locsysop
to: Paul Edwards
from: Bob Lawrence
date: 1996-11-24 10:30:28
subject: TIC

BL> What's the format of the stat struct? It returns a longint that
 BL> ctime() formats into a huge string but I can't find anything
 BL> else that works on it. Or is it just the DOS integers joined
 BL> together?

 PE> Should be # seconds since 1970.

  How do I turn that into time, like 12-12-96?

 PE> I didn't think you could delete entries via opendir(). You can
 PE> via remove() though. And that's ISO C rather than POSIX, too
 PE> boot! BFN. 

  Under opendir() it says: "directory entries can be created or
deleted while the directory stream is being read." You end up with a
dirent struct of just one pointer (fuckwits!) dirent->d_name of any
length. I guess you can write to the directory itself, if you kept
the length! But you can't access anything but names.

  I haven't tried it yet, but I assume the sequence runs:

  opendir()
  readdir() to get the name(s)
  closedir()
  fopen() to open the file
  stat() to find the size and time of the *open* file
  dostuff() including copying the bastard
  fclose()
  utime() if you want to change the time of the *closed* file
  remove() the closed file if you want a move() or delete.

  This should work DOS/Windows/UNIX, but most of them are not ansi...

Regards,
Bob
___ Blue Wave/QWK v2.12
@EOT:

---
* Origin: Precision Nonsense, Sydney (3:711/934.12)
SEEN-BY: 711/934 712/610
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.