#1 2023-05-04 20:01:54

tbo
Member
Registered: 2015-04-20
Posts: 354

Function I7zWriter.AddFiles

Delphi 11.3, mORMot2 GitHub commit 5420 (e4ccc8e)

Function I7zWriter.AddFiles:

/// add (or replace) some files from a folder within the archive
procedure AddFiles(const Dir, Path, Wildcard: TFileName; recurse: boolean);

I can't find a reasonable use for the "Path" and "Wildcard" parameters. If I write the following:

libWriter.AddFiles('c:\mORMot2\src\', 'mormot_2023-05-04', '*', True);

The result is a 7z file without files with a directory structure that looks like this:

mormot_2023-05-04\c_\mORMot2\src\app
mormot_2023-05-04\c_\mORMot2\src\core
...

It would be interesting if "Path" was the starting path in the 7z file. Then you could create something like this, for example:

mormot_2023-04-28\app
mormot_2023-04-28\core
...
mormot_2023-05-04\app
mormot_2023-05-04\core

This would be a very useful functionality.

I can't find a useful use for the "Wildcard" either. Only for "*" I get a result. Which values are intended here? The only solution that works for me is:

libWriter.AddFiles('c:\mORMot2\src\', '', '*', True);

I would have liked it better to use FindFiles from unit mormot.core.search here.

With best regards
Thomas

Offline

#2 2023-05-05 07:55:21

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,713
Website

Re: Function I7zWriter.AddFiles

Offline

#3 2023-05-05 18:20:38

tbo
Member
Registered: 2015-04-20
Posts: 354

Re: Function I7zWriter.AddFiles

Now these tests have been passed:

libWriter.AddFiles('c:\mORMot2\src\', '', '*', True);
libWriter.AddFiles('c:\mORMot2\src\', 'mORMot_2023-05-05', '*', True);
libWriter.AddFiles('c:\mORMot2\src\', 'mORMot_2023-05-05', '*.pas', True);
libWriter.AddFiles('c:\mORMot2\src\', 'mORMot_2023-05-05', '*.pas;*.inc', True);

With this it works as expected. Thanks for this.

With best regards
Thomas

Offline

Board footer

Powered by FluxBB