Re: parameter --include-from-file with at least unclear usage

Stefan Hammerl via Dar-support <[email protected]>
Newsgroups gmane.comp.sysutils.backup.dar.support
Message-ID <CAA27OgTjN15Xr15R8MKPJtP=KukdVauVdajrqp9zQuaxHsUSCg@mail.gmail.com>
Hi,

thanks for your answer.

My test case is as following:
The call to dar to extract files listed in file_list.txt from the
archive DARBasename.1.dar:
C:\Users\User\git\DARBackup\Test\Root>C:\Users\User\git\dar64-2.6.10-win64\dar64-2.6.10-win64\dar.exe
-x /cygdrive/c/Users/User/git/DARBackup/Test
/Backup/DARBasename -w --include-from-file
C:\Users\User\AppData\Local\Temp\file_list.txt -R
/cygdrive/c/Users/User/Documents

The DOS style file file_list.txt includes:
Test-case 1:
A\r\n
A/B\r\n
A/B/Text.txt\r\n

Test-case 2:
A\r\n
A/B\r\n
A/B/Text.txt

The output of dar is:
Test-case 1:
[...]3 inode(s) restored[...]

Test-case 2:
[...]2 inode(s) restored[...]

> if the file is a "DOS" text file (lines ending with \r followed by a
> \n character), the file matching fails for all except for the last
> entry of
> the listing file.
I think this is not the case as in test-case 1 there should not be
extracted any file otherwise.

> Which type of text file are you using?
On Unix I am currently using unix files and on windows dos files.

> I can update dar 2.6.x to take care of DOS formatted text files, but I
> could not reproduce the problem you met, so this update may not match
> you need.
Thank you, it is no problem for me to use unix style new line
characters instead.

Best regards,
Stefan

Am Mo., 11. Jan. 2021 um 13:01 Uhr schrieb Denis Corbin <[email protected]>:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Hi,
>
> I could not reproduce the same problem:
> if the file listing is a Unix text file (lines ending with \n
> characters) the file listing behaves the same with or without ending
> new-line, thus it behaves as expected.
>
> if the file is a "DOS" text file (lines ending with \r followed by a
> \n character), the file matching fails for all except for the last
> entry of
> the listing file. This is due to the trailing \r that is kept as part of
> the filename in the file listing internal structure in libdar and when
> reading filename using system calls, the provided filename has no
> ending \r.
>
> I can update dar 2.6.x to take care of DOS formatted text files, but I
> could not reproduce the problem you met, so this update may not match
> you need.
>
> Which type of text file are you using?
> Are you running dar directly for Windows or from within cygwin?
>
> Regards,
> Denis
>
> On 06/01/2021 21:23, Denis Corbin wrote:
> > On 06/01/2021 19:19, Stefan Hammerl via Dar-support wrote:
> >> Hello,
> >
> > Hello,
> >
> >
> >> I've experienced troubles using the --include-from-file
> >> parameter. The man page says entries have to be separated by a
> >> newline. However it does not state anything about the presence of
> >> a newline at the end of the file. Therefore my expectation is,
> >> that it does not matter if it is there or not.
> >
> > correct, it should not be necessary to end the file with an final
> > carriage-return (newline).
> >
> >> Actually the behaviour is different on Ubuntu/Linux comparing to
> >> Windows. Whereas in Ubuntu it really doesn't matter, in Windows
> >> the last file entry before a newline is silently ignored.
> >
> > strange, the code cutting file into a set of lines is the same and
> > is part of dar... let me a couple of day to find the time to check
> > the reason of this difference.
> >
> >
> >> I suggest to add to the man page that there must not be a new
> >> line at the end of the file.
> >
> > that's an good option. But I will first try to figure out the
> > reason of this difference between Linux and Windows.
> >
> >
> >> DAR-version is 2.6.10 in both environments. Windows 10 Pro
> >> Version 1903.
> >
> > thanks for this detailed info.
> >
> >
> >> With best regards, Stefan
> >
> >
> > Regards, Denis
> >
> >
> > _______________________________________________ Dar-support mailing
> > list [email protected]
> > https://lists.sourceforge.net/lists/listinfo/dar-support
> >
> -----BEGIN PGP SIGNATURE-----
>
> iQIzBAEBCgAdFiEEOzEprx3d76WjfYGPCDGwvQPYsYIFAl/8PeYACgkQCDGwvQPY
> sYK56xAAx+FP8ymEbtYBBNJEpejV303VfFSB4bU7u2lcDvnaWpgHDIeLwlaD5DbF
> xilRkdT5z2x8fSwm/Dtx/gt1Xz2Zy3EfoO741XqSJaB4+UQ5NDGhsiwfnPw3+WBM
> eoiQ3fB2aHG1xMnvbgCIzVFv9V5H+HeUu/vuI1iKQ40QBPNS5xZ8RUqqXJ4Es6c8
> lOjzXtMLrzU8WU32L++eMrXMVew1+rlL+pSGvrDbvY7NLzEmDfcTFA9ANvDxkamh
> 4wbmuBCUc3XoqLziAaz1zaghxF0q+5xTYyVyGzWJxZShliq5lvbduosUUvjRpAwS
> f3vk97S7TjWFHdPtVzpNimMgPqJdXaOBZHuXX07UFhEV9TXor0YkIeQMCK8H0L92
> mkMjUid0P0Ns8Ctfl2efNwcBg8ozfhmQNF59StAxf1P+PK/YXPgly8+s2E4S+lvo
> /g3O4SZ06MUh4RsfJYGIp8hfv76cR+YcmC84rgTBgFQHiIB+47sNjmN735Q4EbFh
> ilfjKOzHBwFGuugSz6Ru9sd2gHFewOnUFKXRDsEIK8dQIGw7zTDoeE6IouFHXZeV
> IP5ZcWenwmtTzxp+zA6nRF4VtM5r1Tb1Ysglf/rEGkh7YwxYNuUlAScgFrO1N7Ex
> fB+VxzyGFiagKTM73XKa1AsrJeXUrsoYG3QCAs088AJhFmMJsXc=
> =uiNi
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> Dar-support mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dar-support
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.