2

Is these a function that behaves like file-truename on local files, but does not add the /protocol:host: prefix on remote files? Currently if I run

(file-truename "./file.ext")

while in a remote directory, I get "/ssh:host:/remote/path/file.ext". but I just want "/remote/path/file.ext"

The reason that I am asking is that pdf export in org-mode does not work on remote file for me. I have tracked the problem down to the call (org-latex-compile "./myfile.org") which uses file-truename to produce the actual file name that is supplied to the latex shell call. This causes problems on remote files because the tramp prefix is included in the shell call. I would like to write a patch for this.

1
  • Did you find a solution to your problem with org -> PDF export? I have the same issue now with remote image files in my org source.
    – Tyler
    Aug 11, 2017 at 21:09

2 Answers 2

4

The behavior as described by you is the intended one. If you want only the remote pathname, you must call

(file-remote-p (file-truename "./file.ext") 'localname)

1
(expand-file-name "./file.ext")
=> "/home/brian/file.ext"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.