tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `tramp_perl_file_attributes /root/ integer' returns with error


From: Michael Albinus
Subject: Re: `tramp_perl_file_attributes /root/ integer' returns with error
Date: Tue, 20 Jul 2010 13:37:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Terrence Brannon <address@hidden> writes:

> yes, that is done. and 'which' is now found, but /tmp/456 is the same
>
> address@hidden:/tmp > cat 456
> syntax error at -e line 3, near ");"
> Execution of -e aborted due to compilation errors.
> address@hidden:/tmp >

Hmm, still strange.

I've found an error in the definition of "tramp_perl_file_attributes":
it passes "$3" to the Perl program, although only 2 arguments are given
when "tramp_perl_file_attributes" is called. The other shells seem to
ignore this; maybe it is the problem in your case. I've fixed it in the
repository, could you, please, try?

If it still doesn't work, could you, please, check on the remote host
the following commands:

# which \perl

# tramp_perl_file_attributes () {
\perl -e '
@stat = lstat($ARGV[0]);
if (address@hidden) {
    print "nil\n";
    exit 0;
}
if (($stat[2] & 0170000) == 0120000)
{
    $type = readlink($ARGV[0]);
    $type = "\"$type\"";
}
elsif (($stat[2] & 0170000) == 040000)
{
    $type = "t";
}
else
{
    $type = "nil"
};
$uid = ($ARGV[1] eq "integer") ? $stat[4] : "\"" . getpwuid($stat[4]) . "\"";
$gid = ($ARGV[1] eq "integer") ? $stat[5] : "\"" . getgrgid($stat[5]) . "\"";
printf(
    "(%s %u %s %s (%u %u) (%u %u) (%u %u) %u.0 %u t (%u . %u) -1)\n",
    $type,
    $stat[3],
    $uid,
    $gid,
    $stat[8] >> 16 & 0xffff,
    $stat[8] & 0xffff,
    $stat[9] >> 16 & 0xffff,
    $stat[9] & 0xffff,
    $stat[10] >> 16 & 0xffff,
    $stat[10] & 0xffff,
    $stat[7],
    $stat[2],
    $stat[1] >> 16 & 0xffff,
    $stat[1] & 0xffff
);' "$1" "$2"
}

# set -xv

# tramp_perl_file_attributes /root/ integer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]