Variable: tramp-perl-file-name-all-completions
tramp-perl-file-name-all-completions is a variable defined in
tramp-sh.el.gz.
Value
"%p -e '\n$dir = $ARGV[0];\nif ($dir ne \"/\") {\n $dir =~ s#/+$##;\n}\nopendir(d, $dir) || die(\"$dir: $!\\nfail\\n\");\n@files = readdir(d); closedir(d);\nprint \"(\\n\";\nforeach $f (@files) {\n ($p = $f) =~ s/\\\"/\\\\\\\"/g;\n ($q = \"$dir/$f\") =~ s/\\\"/\\\\\\\"/g;\n print \"(\\\"$q\\\"\",\n ((-e \"$q\") ? \" t\" : \" nil\"),\n ((-r \"$q\") ? \" t\" : \" nil\"),\n ((-d \"$q\") ? \" t\" : \" nil\"),\n ((-x \"$q\") ? \" t\" : \" nil\"),\n \")\\n\";\n}\nprint \")\\n\";\n' \"$1\" %n"
Documentation
Perl script to produce output suitable for use with
file-name-all-completions on the remote file system. It returns the
same format as tramp-bundle-read-file-names(var)/tramp-bundle-read-file-names(fun).
Format specifiers are replaced by tramp-expand-script, percent
characters need to be doubled.
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
(defconst tramp-perl-file-name-all-completions "\
%p -e '
$dir = $ARGV[0];
if ($dir ne \"/\") {
$dir =~ s#/+$##;
}
opendir(d, $dir) || die(\"$dir: $!\\nfail\\n\");
@files = readdir(d); closedir(d);
print \"(\\n\";
foreach $f (@files) {
($p = $f) =~ s/\\\"/\\\\\\\"/g;
($q = \"$dir/$f\") =~ s/\\\"/\\\\\\\"/g;
print \"(\\\"$q\\\"\",
((-e \"$q\") ? \" t\" : \" nil\"),
((-r \"$q\") ? \" t\" : \" nil\"),
((-d \"$q\") ? \" t\" : \" nil\"),
((-x \"$q\") ? \" t\" : \" nil\"),
\")\\n\";
}
print \")\\n\";
' \"$1\" %n"
"Perl script to produce output suitable for use with
`file-name-all-completions' on the remote file system. It returns the
same format as `tramp-bundle-read-file-names'.
Format specifiers are replaced by `tramp-expand-script', percent
characters need to be doubled.")