如题,有没有函数可以调用?

解决方案 »

  1.   

    Tests if a specified file exists.UnitSysUtilsCategoryfile management routinesDelphi syntax:function FileExists(const FileName: string): Boolean;C++ syntax:extern PACKAGE bool __fastcall FileExists(const AnsiString FileName);DescriptionFileExists returns true if the file specified by FileName exists. If the file does not exist, FileExists returns false.
    以上是检测文件是否存在
    以下检测文件是否为空
    FFileStream: TFileStream;
    begin
     FFileStream := TFileStream.Create('C:\Test.DAT', mOpenRead);
     if FFileStream.Size=0 then //为空end;
      

  2.   

    function MyFileSize(fname: string): Integer;
    var
      fstre: TFileStream;
      l: DWORD;
      h: DWORD;
    begin
      fstre := CreateFileStream(fname, fmOpenRead or fmShareDenyNone);
      if fstre <> nil then
      begin
        Result := fstre.Size;
        fstre.Free();
      end
      else
        Result := -1;
    end;
      

  3.   

    if not fileExists() then
    begin
    end;
      

  4.   


    API 
    Function GetFileSize(var Size_HI:LongInt):LongInt;stdcall;