c

来自「C程序设计经典900例.zip」· 代码 · 共 28 行

TXT
28
字号
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <sys\stat.h>
#include <time.h>

void main(void)
  {
    int handle;

    struct stat buffer;

    if ((handle = open("\\AUTOEXEC.BAT", O_RDONLY)) == -1)
     printf("Error opening \\AUTOEXEC.BAT\n");
    else
      {
        if (fstat(handle, &buffer))
          printf("Error getting file information\n");
        else
          printf("AUTOEXEC.BAT is %ld bytes Last used %s\n",
            buffer.st_size, ctime(&buffer.st_atime));
        close(handle);
      }
 }

           

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?