파일 정보 가져오기

435 단어
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>

//      ,  Byte 
int getFileSize(char* fileName)
{
  int fd;
  struct stat stat;
  
  if(fd = open(fileName, O_RDONLY) < 0)
  {
    printf("Open file ERROR
"); return(FALSE); } return((fstat(fd,&stat) < 0) ? FALSE : stat.st_size); }

좋은 웹페이지 즐겨찾기