函式功能
函式名: getftime
功 能: 取檔案日期和時間
用 法: int getftime(int handle, struct ftime *ftimep);
程式示例
#include
#include
int main(void)
{
FILE *stream;
struct ftime ft;
if ((stream = fopen("TEST.$$$",
"wt")) == NULL)
{
fprintf(stderr,
"Cannot open output file.\n");
return 1;
}
getftime(fileno(stream), &ft);
printf("File time: %u:%u:%u\n",
ft.ft_hour, ft.ft_min,
ft.ft_tsec * 2);
printf("File date: %u/%u/%u\n",
ft.ft_month, ft.ft_day,
ft.ft_year+1980);
fclose(stream);
return 0;
}