Not found error when adding two or more directories
Brought to you by:
andrew_belov
[gt@Paradise Xarchiver-0.3]$ arj a /Stuff2/test.arj
/Stuff/Xarchiver_Test/5yearsc4/
/Stuff/Xarchiver_Test/unpv12e/
ARJ32 v 3.10, Copyright (c) 1998-2004, ARJ Software
Russia. [28 Nov 2005]
Creating archive : /Stuff2/test.arj
0 file(s)
Can't find /Stuff/Xarchiver_Test/unpv12e//*
Found 1 error(s)!
[gt@Paradise Xarchiver-0.3]$
The directories exists:
[gt@Paradise Xarchiver-0.3]$ ls -ld
/Stuff/Xarchiver_Test/5yearsc4/
/Stuff/Xarchiver_Test/unpv12e/
drwxrwxrwx 6 gt users 78 2005-09-28 07:59
/Stuff/Xarchiver_Test/5yearsc4/
drwxr-xr-x 2 gt users 25 2005-09-28 11:02
/Stuff/Xarchiver_Test/unpv12e/
[gt@Paradise Xarchiver-0.3]$
Is it a bug or am I wrong ?
Logged In: YES
user_id=496535
This exists for historical reasons. When the first filename
is a directory, ARJ thinks that all subsequent filenames
should be searched relative to that directory. Adding a "*"
after the final "/" should fix it.
Logged In: YES
user_id=818290
Unfortunately it doesn't:
[gt@Paradise Xarchiver-0.3]$ arj a /Stuff2/test.arj
/Stuff/Xarchiver_Test/5yearsc4/ /Stuff/Xarchiver_Test/unpv12e/*
ARJ32 v 3.10, Copyright (c) 1998-2004, ARJ Software Russia.
[28 Nov 2005]
Creating archive : /Stuff2/test.arj
0 file(s)
Can't find /Stuff/Xarchiver_Test/unpv12e/configure.in
Found 1 error(s)!
[gt@Paradise Xarchiver_Test]$ ls -l
/Stuff/Xarchiver_Test/unpv12e/configure.in
-rw-r--r-- 1 gt users 20353 1997-07-10 08:19
/Stuff/Xarchiver_Test/unpv12e/configure.in
The same happens adding a * after the first "/"
Hope you can fix this error,
gt67
Logged In: YES
user_id=496535
OK, I might have stated this a bit ambiguously - the correct
syntax in your case should be as follows:
arj a /Stuff2/test.arj /Stuff/Xarchiver_Test/5yearsc4/*
/Stuff/Xarchiver_Test/unpv12e/*
Do you mean this doesn't work as well? If so, could you
please provide more detail about the platform and shell
being used?
Logged In: YES
user_id=818290
[gt@Paradise ~]$ arj a /Stuff2/test.arj
/Stuff/Xarchiver_Test/5yearsc4/* /Stuff/Xarchiver_Test/unpv12e/*
ARJ32 v 3.10, Copyright (c) 1998-2004, ARJ Software Russia.
[28 Nov 2005]
Creating archive : /Stuff2/test.arj
0 file(s)
Can't find /Stuff/Xarchiver_Test/5yearsc4/data/*
Can't find /Stuff/Xarchiver_Test/5yearsc4/pygtk-2.6.2/*
Can't find /Stuff/Xarchiver_Test/5yearsc4/resynthesizer-0.13/*
Can't find /Stuff/Xarchiver_Test/unpv12e/configure.in
My shell is:
[gt@Paradise ~]$ bash --version
bash --version
GNU bash, version 3.00.16(1)-release (i686-pc-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.
[gt@Paradise ~]$
My platform is:
Linux Paradise 2.6.11.10-ARCH #1 SMP Mon May 16 14:58:59 PDT
2005 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GenuineIntel
GNU/Linux
My distro is archlinux upgraded to current. Hope this helps.
Logged In: YES
user_id=496535
Local testing with bash-3.1 confirms that the problem is related to a known case of wildcard expansion. Upon encountering an empty directory, ARJ begins to treat all subsequent directories as relative paths. This can be prevented by suppressing wildcard expansion, i.e. either by prefixing the "*" with a "\" or by enclosing every path argument in quotes.
We may take out this kludge in a subsequent legacy removal release but definitely not in the 3.10 branch. Until that is done, you may consider applying the following patch that disables it:
--- arj.c.~1.13.~ 2005-06-21 23:53:12.000000000 +0400
+++ arj.c 2005-12-20 03:00:59.989103320 +0300
@@ -1176,10 +1176,7 @@
cnv_cmdline_fnm(tmp_ptr);
if(tmp_ptr[0]!='\0')
{
- name[0]='\0';
- if(is_add_cmd)
- strcat(name, target_dir);
- strcat(name, tmp_ptr);
+ strcpy(name, tmp_ptr);
count=0;
if(flist_add_files(&flist_main, &flist_exclusion, name, expand_wildcards, recurse_subdirs, allow_any_attrs, &count))
{
@@ -1202,10 +1199,7 @@
{
if(cmd==ARJ_CMD_ORDER&&strpbrk(f_arg_array[j], wildcard_pattern))
error(M_ORDER_WILDCARD);
- name[0]='\0';
- if(is_add_cmd)
- strcat(name, target_dir);
- strcat(name, f_arg_array[j]);
+ strcpy(name, f_arg_array[j]);
count=0;
if(flist_add_files(&flist_main, &flist_exclusion, name, expand_wildcards, recurse_subdirs, allow_any_attrs, &count))
{