[fpc-pascal] Adding files to a tar file

2014-01-21 Thread luciano de souza
Hello all, This code should add all the files of a directory in a tar file. program e01; {$mode objfpc}{$H+} uses libtar, sysutils; var archive: TTarWriter; search: TSearchRec; BEGIN archive := TTarWriter.create('arquivo.tar'); with archive do begin try FindFirst('/home/luciano/Documentos/*',

Re: [fpc-pascal] Adding files to a tar file

2014-01-21 Thread Flávio Etrusco
On Tue, Jan 21, 2014 at 10:45 PM, luciano de souza luchya...@gmail.com wrote: Hello all, This code should add all the files of a directory in a tar file. program e01; {$mode objfpc}{$H+} uses libtar, sysutils; var archive: TTarWriter; search: TSearchRec; BEGIN archive :=

Re: [fpc-pascal] Adding files to a tar file

2014-01-21 Thread waldo kitty
On 1/21/2014 7:45 PM, luciano de souza wrote: The program compiles, but I got an error. The message says that the first file of the directory can't be opened. What is wrong? your code uses faAnyfile... perhaps you need to be more restrictive? is your problem caused by a sub-directory with