Obtains the current logical length of the file in bytes.
DWORD GetLength( )
The length of the file.
EX1
void file_GetLength_ex1() { string strFile = "c:\\test.txt"; file ff(strFile, file::modeCreate | file::modeWrite); vector<float> vf(5); for ( int ii = 0; ii < vf.GetSize(); ii++ ) vf[ii] = ii*1.25; ff.WriteFloat(vf, sizeof(float), vf.GetSize()); ff.Close(); if( ff.Open(strFile, file::modeRead|file::typeBinary) ) { DWORD dwLen = ff.GetLength(); printf("Length of file %s is %d bytes\n", strFile, dwLen); ff.Close(); } }
origin.h