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 the
Yes, that's the mistake. I forgot the fact "search.name" does not
returns a full path. This code works very well.
program e01;
{$mode objfpc}{$H+}
uses
libtar, sysutils;
var
archive: TTarWriter;
search: TSearchRec;
path: string;
BEGIN
archive := TTarWriter.create('arquivo.tar');
with archive do
On Tue, Jan 21, 2014 at 10:45 PM, luciano de souza 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 := TTarWriter.cre
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/*',