We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I run to_pdf sample.tex and had this error Error moving output file: rename /tmp/latex_1847002621/input.pdf sample.pdf: invalid cross-device link
to_pdf sample.tex
Error moving output file: rename /tmp/latex_1847002621/input.pdf sample.pdf: invalid cross-device link
The to_pdf plugin fails when attempting to move a generated PDF file across different filesystems using the os.Rename function.
to_pdf
os.Rename
Found out that this issue is triggered because my /tmp folder and the current working directory are mounted on separate filesystems.
/tmp
Output of the df showing different file systems (using btrfs here):
df /tmp . Filesystem Size Used Avail Use% Mounted on tmpfs 7.5G 996K 7.5G 1% /tmp /dev/nvme0n1p3 1.8T 653G 1.2T 37% /home
Environment Details: Operating System: Arch Linux Plugin Version: to_pdf (latest) FileSystem: df /tmp . Filesystem Size Used Avail Use% Mounted on tmpfs 7.5G 996K 7.5G 1% /tmp /dev/nvme0n1p3 1.8T 653G 1.2T 37% /home
No response
The text was updated successfully, but these errors were encountered:
Replacing os.Rename with a combination of io.Copy and os.Remove solves the issue. I will raise a pull request.
io.Copy
os.Remove
// Modified Code err = copyFile(pdfPath, outputFile) if err != nil { fmt.Fprintf(os.Stderr, "Error moving output file: %v\\n", err) os.Exit(1) } // Function to copy files func copyFile(src, dst string) error { sourceFile, err := os.Open(src) if err != nil { return err } defer sourceFile.Close() destFile, err := os.Create(dst) if err != nil { return err } defer destFile.Close() _, err = io.Copy(destFile, sourceFile) if err != nil { return err } return destFile.Sync() }
Sorry, something went wrong.
No branches or pull requests
What happened?
I run
to_pdf sample.tex
and had this errorError moving output file: rename /tmp/latex_1847002621/input.pdf sample.pdf: invalid cross-device link
The
to_pdf
plugin fails when attempting to move a generated PDF file across different filesystems using theos.Rename
function.Found out that this issue is triggered because my
/tmp
folder and the current working directory are mounted on separate filesystems.Output of the df showing different file systems (using btrfs here):
Version check
Relevant log output
Environment Details: Operating System: Arch Linux Plugin Version: to_pdf (latest) FileSystem: df /tmp . Filesystem Size Used Avail Use% Mounted on tmpfs 7.5G 996K 7.5G 1% /tmp /dev/nvme0n1p3 1.8T 653G 1.2T 37% /home
Relevant screenshots (optional)
No response
The text was updated successfully, but these errors were encountered: