CºÍC++»ñÈ¡Îļþ´óСµÄ·½·¨×ܽᣨת£©
1.MFCÖеķ½·¨£º(C++) CFileStatus status;
CFile::GetStatus("D:\\test.txt",status);
long lSizeOfFile;
lSizeOfFile = status.m_size; lSizeOfFileµÄÖµ¾ÍÊÇD:\\test.txtÎļþµÄ´óС 2.±ê×¼C»ñµÃÎļþ´óСµÄ5ÖÖ·½·¨
(×¢Ò⣺"__FILE__"Ö¸µÄÊǵ±Ç°Îļþ£¬Äã¿ÉÒÔ¸ÄΪÓÐЧ·¾¶µÄÄ¿±êÎļþ£¬±ÈÈç"D:\\test.txt"£©
#include "stdafx.h"
#include "stdio.h"
#include
#include
#include int getfilesize()
{
int iresult;
struct _stat buf;
iresult = _stat(__FILE__,&buf);
if(iresult == 0)
{
return buf.st_size;
}
return NULL;
} int getfilesize01()
{
int fp;
fp=_open(__FILE__,_O_RDONLY);
if(fp==-1)
return NULL;
return _filelength(fp);
//return NULL;
} int getfilesize02()
{
int fp;
fp=_open(__FILE__,_O_RDONLY);
if(fp==-1)
return NULL;
return _lseek(fp,0,SEEK_END);
//return NULL;
} int getfilesize03()
{
int fp;
fp=_open(__FILE__,_O_RDONLY);
if(fp==-1)
return NULL;
return _lseek(fp,0,SEEK_END);
//return NULL;
} int getfilesize04()
{
FILE *fp;
if((fp=fopen(__FILE__,"r"))==NULL)
return 0;
fseek(fp,0,SEEK_END);
return ftell(fp); //return NULL;
} int g
Ïà¹ØÎĵµ£º
×î½üÒòΪÑо¿Ò»¸ö¶«Î÷£¬²¢ÇÒÔںܾÃÒÔÇ°¾ÍÏë°ÑpythonºÃºÃ¿´¿´¡£ÕýºÃÂú×ãÎҵĺÃÆæÐÄ¡£ÎÒÿÌìÉÏ°à×öµÃÓÎÏ·¶¼ÊÇÓÃlua£¬Ò²ÊÇÒ»ÃźÜÇ¿´óµÄ½Å±¾ÓïÑÔ¡£¿ÉÄÜÎÒ¸üϲ»¶pythonµÄËõ½øÇø·ÖºÍÃæÏò¶ÔÏó°É¡£ ½ñÌìֻдһ¸ö¼òµ¥µÄÀý×Ó¡£Ò»¸ö¼òµ¥µÄpython½Å±¾£¬¾ÍÒ»¸öº¯Êý£¬ÓÃC/C++È¥µ÷Ó᣿ÉÄÜÕâÒ²ÊÇ×÷Ϊ³ÌÐòÀ´Ëµ×î¹ØÐĵÄÒ»¼þÊ¡£ËùÒÔÎÒµÄpytho ......
1.JavaÔÚÐéÄâ»úÉÏÔËÐÐ
JavaÔ´´úÂë²¢²»ÊDZ»±àÒë³ÉΪÆÕͨµÄ»úÆ÷´úÂë¡£¶øÊDZ»·Òë³ÉΪÐéÄâ»ú¿ÉÒÔÖ´ÐеĴúÂë¡£Ò»¸öJava½âÊÍÆ÷×îÖÕÖ´ÐÐÕâЩ´úÂë¡£ÕâÆäÖÐûÓÐÁ¬½ÓµÄ¹ý³Ì£»½âÊÍÔÚÐèÒªµÄʱºò¶¯Ì¬µÄ¼ÓÔØһЩÀࣻ
2.JavaÊÇÍêÈ«ÃæÏò¶ÔÏóµÄ
JavaÊÇÒ»ÖÖÍêÈ«ÃæÏò¶ÔÏóµÄÓïÑÔ¡£ÕâÒâζ×ÅÄã¶ÔÈκÎÒ»¸öJava¶ÔÏóËù×öµÄ¶¯×÷¶¼ÊÇͨ¹ýÒ ......
×î½üµÄÒ»¸öÏîÄ¿ÔÚʹÓÃC3P0µÄÁ¬½Ó³Ø£¬Êý¾Ý¿âΪMysql¡£¿ª·¢²âÊÔûÓÐÎÊÌ⣬ÔÚÔËÐÐÖÐÿ¸öÒ»¶Î³¤µÄ¿ÕÏÐʱ¼ä¾Í³öÏÖÒì³£Communications link failure due to underlying exception:
java ´úÂë
²é¿´ÁËMysqlµÄÎĵµ£¬ÒÔ¼°Connector/JµÄÎĵµÒÔ¼°ÔÚÏß˵Ã÷·¢ÏÖ£¬³öÏÖÕâÖÖÒì³£µÄÔÒòÊÇ£º
Mysql·þÎñÆ÷ĬÈϵēwait_timeout&rdquo ......
×î½üÓиöÏîÄ¿ÐèÒªÔÚUNIXÏÂÓÃC×ö£¬ºÜ¾ÃûÓùýCÁË£¬·¢ÏÖЩÎÊÌâÈÝÒ׸ã´í¡£
Õâ¸öÎÊÌâºÜÈÝÒ׸ã´í£¬²¢µ¼ÖºܶàÎÊÌ⣬ÐèҪǿµ÷µÄÊÇfreadº¯Êý·µ»ØµÄ²¢²»ÊÇ×Ö½ÚÊý¡£
realRead = fread(buf,item,count,fp) £¨Ã¿´Î¶Áitem´óСµÄÊý¾Ý¿é£¬·Öcount´Î ......
ΪÁËʹÓÃCÓïÑÔ±à³ÌÖ±½Ó¶ÁÈ¡dbfÎļþ£¬ÐèÒªÁ˽âdbfÎļþµÄ¶þ½øÖÆÎļþ¸ñʽ£¬ÏÂÃæ¸ø³ö¼òÒªµÄ˵Ã÷¡£
±íÎļþÓÉÍ·¼Ç¼¼°Êý¾Ý¼Ç¼×é³É¡£Í·¼Ç¼¶¨Òå¸Ã±íµÄ½á¹¹²¢°üº¬Óë±íÏà¹ØµÄÆäËûÐÅÏ¢¡£Í·¼Ç¼ÓÉÎļþλÖà 0 ¿ªÊ¼¡£Êý¾Ý¼Ç¼1½ô½ÓÔÚÍ·¼Ç¼֮ºó£¨Á¬ÐøµÄ×Ö½Ú£©£¬°üº¬×Ö¶ÎÖÐʵ¼ÊµÄÎı¾¡£
¼Ç¼µÄ³¤¶È£¨ÒÔ×Ö½ÚΪµ¥Î»£©µÈÓÚËùÓÐ×ֶζ¨Òå ......