antoine_1977
Messages postés29Date d'inscriptionlundi 29 décembre 2003StatutMembreDernière intervention 1 novembre 2004 31 juil. 2004 à 16:54
pas super, mais comme c'est une suggestion de sa part, je ne vois pas où est le problème...
Et puis tout le monde n'est pas sous VC++ certain utilisent borland et les fonctions que vous avez donné (hormis celle de Kaid) ne fonctionnent pas sur borland, ou bien il ne s'agit pas d'élément standard...
// help-example from Borland:
#include <sys\stat.h>
#include <stdio.h>
#include <time.h>
#define FILENAME "TEST.$$$"
int main(void)
{
struct stat statbuf;
FILE *stream;
/* open a file for update */ if ((stream fopen(FILENAME, "w+")) NULL)
{
fprintf(stderr, "Cannot open output file.\n");
return(1);
}
/* get information about the file */
stat(FILENAME, &statbuf);
fclose(stream);
/* display the information returned */
if (statbuf.st_mode & S_IFCHR)
printf("Handle refers to a device.\n");
if (statbuf.st_mode & S_IFREG)
printf("Handle refers to an ordinary file.\n");
if (statbuf.st_mode & S_IREAD)
printf("User has read permission on file.\n");
if (statbuf.st_mode & S_IWRITE)
printf("User has write permission on file.\n");
printf("Drive letter of file: %c\n", 'A'+statbuf.st_dev);
printf("Size of file in bytes: %ld\n", statbuf.st_size);
printf("Time file last opened: %s\n", ctime(&statbuf.st_ctime));