Arquivos - tamanho em byte |
Top Previous Next |
|
Function TamArquivo(Arq: string): integer begin with TFileStream.Create(Arq, fmRead or fmOpenShareExclusive) do try Result := Size; finally Free; end; end;
-------------- ESTA MANEIRA É MELHOR
function FileSize(const arquivo: String): LongInt; var SearchRec: TSearchRec; begin if FindFirst(ExpandFileName(mlStrTran(arquivo, '/', '\')), faAnyFile, SearchRec) = 0 then result := SearchRec.Size else result := -1; FindClose(SearchRec); end; |