Hi,
recently tramp stopped working for me, sitting at
tramp_file_attributes /home
and not doing anything much. tramp_file_attributes is a ksh-function,
and for me is defined as
$ tramp_file_attributes () {
/bin/perl -e '$f = $ARGV[0];
@s = lstat($f);
if (($s[2] & 0170000) == 0120000) { $l = readlink($f); $l = "\"$l\""; }
elsif (($s[2] & 0170000) == 040000) { $l = "t"; }
else { $l = "nil" };
printf("(%s %u %u %u (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) (%u %u))\n",
$l, $s[3], $s[4], $s[5], $s[8] >> 16 & 0xffff, $s[8] & 0xffff,
$s[9] >> 16 & 0xffff, $s[9] & 0xffff, $s[10] >> 16 & 0xffff, $s[10] & 0xffff,
$s[7], $s[2], $s[1] >> 16 & 0xffff, $s[1] & 0xffff, $s[0] >> 16 & 0xffff, $s[0] &
0xffff);' $1 2>/dev/null
}
Executing this in a ksh on the same computer, I get:
$ tramp_file_attributes /home
(t 2 0 0 (15118 11384) (15118 11384) (15118 11384) 9 16749 t (0 . 3) (24 1))
So this should work...
Kay suggested to post this to the list, together with the following
information:
* Which version of perl:
$ /bin/perl -v
This is perl, version 5.004_04 built for IP22-irix
Copyright 1987-1997, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.
* The output of the script, as called from tramp, without the
2>/dev/null
We than have
$ tramp_file_attributes () {
/bin/perl5 -e '$f = $ARGV[0];
@s = lstat($f);
if (($s[2] & 0170000) == 0120000) { $l = readlink($f); $l = "\"$l\""; }
elsif (($s[2] & 0170000) == 040000) { $l = "t"; }
else { $l = "nil" };
printf("(%s %u %u %u (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) (%u %u))\n",
$l, $s[3], $s[4], $s[5], $s[8] >> 16 & 0xffff, $s[8] & 0xffff,
$s[9] >> 16 & 0xffff, $s[9] & 0xffff, $s[10] >> 16 & 0xffff, $s[10] & 0xffff,
$s[7], $s[2], $s[1] >> 16 & 0xffff, $s[1] & 0xffff, $s[0] >> 16 & 0xffff, $s[0] &
0xffff);' $1
}
and calling this gives us:
$ tramp_file_attributes /home
Number found where operator expected at -e line 3, near "if (($s[2] & 0170000) ==
0120000"
(Might be a runaway multi-line == string starting on line 2)
(Do you need to predeclare if?)
syntax error at -e line 3, near "if (($s[2] & 0170000) == 0120000"
syntax error at -e line 3, near "; }"
Execution of -e aborted due to compilation errors.
So, all the perl-gurus out there, any ideas?
Sven
PS: Let me just add
asterix>/home/utcke% ls -l /bin/perl
lrwxr-xr-x 1 root root 20 May 16 16:12 /bin/perl ->
/usr/sbin/perl-5.004*
asterix>/home/utcke% ls -l /usr/sbin/perl-5.004
-rwxr-xr-x 1 root root 762836 May 16 16:11 /usr/sbin/perl-5.004*
So something obviously did change on that site (unfortunately
something I have no influence about)
--
_ __ The Cognitive Systems Group
| |/ /___ __ _ ___ University of Hamburg
| ' </ _ \/ _` (_-< phone: +49 (0)40 42883-2576 Vogt-Koelln-Strasse 30
|_|\_\___/\__, /__/ fax : +49 (0)40 42883-2572 D-22527 Hamburg
|___/ http://kogs-www.informatik.uni-hamburg.de/~utcke/home.html