본문 바로가기
코드 조각

GetFileSize

by ictlab 2012. 3. 15.
unsigned int __fastcall GetFileSize(String sFilename)
{
   TFileStream *sFile;
   unsigned int Result=0;
   sFile = NULL;

   try
   {
      sFile = new TFileStream(sFilename, fmOpenRead | fmShareDenyNone);
      Result = sFile->Size;
   }
   __finally
   {
      if( sFile )
         delete sFile;
   }
   return Result;
}