From: Fred Subject: Re: Detecting File Size? Date: 10 Aug 1999 00:00:00 GMT Message-ID: <37B04E80.3A3B5684@francemel.com> Content-Transfer-Encoding: 8bit References: <7opbke$9ug7@forums.borland.com> X-Accept-Language: fr Content-Type: text/plain; charset=iso-8859-1 Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.delphi.objectpascal You can use this to have more info about your file (or about a mask file)... With this method, you can get all the informations stored in the WIN32_FIND_DATA structure : typedef struct _WIN32_FIND_DATA { // wfd DWORD dwFileAttributes; FILETIME ftCreationTime; FILETIME ftLastAccessTime; FILETIME ftLastWriteTime; DWORD nFileSizeHigh; DWORD nFileSizeLow; DWORD dwReserved0; DWORD dwReserved1; TCHAR cFileName[ MAX_PATH ]; TCHAR cAlternateFileName[ 14 ]; } WIN32_FIND_DATA; var Dir:String; var Handle:HWND; var StructWin:TWIN32FINDDATA; begin Dir:='c:\ffa*.*'; // This is the files that windows NT put in the root directory... MyList.Clear; Handle:=FindFirstFile(PChar(Dir),StructWin); If Handle<>INVALID_HANDLE_VALUE then begin Repeat If (StructWin.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY)<>FILE_ATTRIBUTE_DIRECTORY then MyList.Lines.Add(IntToStr((StructWin.nFileSizeHigh*($0ffffffff+1)+StructWin.nFileSizeLow))); Until not FindNextFile(Handle,StructWin); Windows.FindClose(Handle); end; end; Try to modify this prog. to do what you really want... Regards from France... Fred David Knapp a écrit : > How can I get the size of an existing file? FileGetAttrb does not return > the file size and the documentation is also vague about this. I would want > to determine if a file exists, then see what it's size is. Using D4 and > NT/95. Thanks for any info.