_stat()

Windows specific forum
Poshu
Enthusiast
Enthusiast
Posts: 459
Joined: Tue Jan 25, 2005 7:01 pm
Location: Canada

_stat()

Post by Poshu »

Code: Select all

Structure stat
  st_dev.l;                   /* ID of device containing file */
  st_ino.l;                   /* File serial number */
  st_mode.w;                  /* Mode of file */
  st_nlink.w;                 /* Number of hard links */
  st_uid.w;                   /* User ID of the file */
  st_gid.w;                   /* Group ID of the file */
  st_rdev.l;                  /* Device ID */
  st_size.l;                  /* file size, in bytes */
  st_atimespec.i;      /* time of last access */
  st_mtimespec.i;      /* time of last data modification */
  st_ctimespec.i;      /* time of last status change */
EndStructure

ImportC "msvcrt.lib"
  _stat(path.p-ascii, *buf)
EndImport

Name.s = OpenFileRequester("Choose a file", "", "", 0)
_stat(Name, @stats.stat)

Debug FileSize(Name)
Debug "File size : " + stats\st_size
Debug "Last access : " + FormatDate("%yyyy/%mm/%dd", stats\st_atimespec)
CallDebugger
Thanks to Djes on the french forum/
GoodNPlenty
Enthusiast
Enthusiast
Posts: 112
Joined: Wed May 13, 2009 8:38 am
Location: Arizona, USA

Re: _stat()

Post by GoodNPlenty »

Very nice, Thank You for sharing.
Post Reply