一个csv(或文本文件)的问题 请教个问题:我想实现如果一个csv文件一发上变化,另一个应用程序就能得知,除了设置计时器不停的扫描之外有没有其他好一点的办法。另,怎样才能得知这个csv文件发生了变化? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你可以看看这个文件的一些信息,可以使用_stat 这个函数,_stat 也是一个结构,里面是文件的一些信息。#include <time.h>#include <sys/types.h>#include <sys/stat.h>#include <stdio.h>void main( void ){ struct _stat buf; int result; char buffer[] = "A line to output"; /* Get data associated with "stat.c": */ result = _stat( "stat.c", &buf ); /* Check if statistics are valid: */ if( result != 0 ) perror( "Problem getting information" ); else { /* Output some of the statistics: */ printf( "File size : %ld\n", buf.st_size ); printf( "Drive : %c:\n", buf.st_dev + 'A' ); printf( "Time modified : %s", ctime( &buf.st_atime ) ); }} 应该用API中的文件系统通知函数。 http://www.china-askpro.com/msg33/qa46.shtml do{}while(0) GetAdaptersInfo函数总是得到ERROR_NO_DATA 有谁知道有什么好的中国的开源论坛吗? 200分请教关于窗口镜像的问题 formview上的控件是不是不能用汉字名啊 这里有一段小代码,是关于QQ密码记录的,有兴趣的来看一下? 窗口标题 有关注册表和其他一些问题 看《深入解析WINDOWS 第四版》的很多不理解的,请教 求助:如何改变按钮控制的默认颜色 我想读取NT的安全日志(就是事件察看器中显示的内容),请问使用什麽API可以获取这些数据? MFC中有没有提供集合类,JAVA和PASCAL中都有的,需要自己实现吗?
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>void main( void )
{
struct _stat buf;
int result;
char buffer[] = "A line to output"; /* Get data associated with "stat.c": */
result = _stat( "stat.c", &buf ); /* Check if statistics are valid: */
if( result != 0 )
perror( "Problem getting information" );
else
{
/* Output some of the statistics: */
printf( "File size : %ld\n", buf.st_size );
printf( "Drive : %c:\n", buf.st_dev + 'A' );
printf( "Time modified : %s", ctime( &buf.st_atime ) );
}
}