Skip to content
New issue

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

gz::common:moveFile() does not work accross different partitions #533

Open
jrutgeer opened this issue Sep 4, 2023 · 2 comments
Open

gz::common:moveFile() does not work accross different partitions #533

jrutgeer opened this issue Sep 4, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jrutgeer
Copy link

jrutgeer commented Sep 4, 2023

Environment

  • Ubuntu 22.04
  • Garden, source built

Description

gz::common:moveFile() calls std::filesystem::rename(), which fails with error generic:18 Invalid cross-device link if the source and destination folder are on different partitions.

Steps to reproduce

E.g. with /home and / mounted on different partitions:

  • Go to home folder,
  • Start a simulation, e.g. gz sim lights.sdf,
  • Load the video recorder plugin and record a video,
  • Save the video to some folder not on the home partition, e.g. to /tmp
  • This yields following error message:
[GUI] [Wrn] [Filesystem.cc:50] Failed common::moveFile (ec: generic:18 Invalid cross-device link)
[GUI] [Err] [VideoRecorder.cc:380] Unable to rename file from[ign_recording.mp4] to [/tmp/aaa.mp4]
  • Do the same steps but start the simulation and save on the same partition --> works correctly.

Possible fix

I found this similar report (though boost rather than std), which proposes to copy + delete original if succesful.

@jrutgeer jrutgeer added the bug Something isn't working label Sep 4, 2023
@mjcarroll
Copy link
Contributor

Interesting, good catch. Would you be interested in doing a PR with the proposed workaround (copy+delete)

@jrutgeer
Copy link
Author

jrutgeer commented Sep 7, 2023

good catch.

Well, I did not catch it, I experienced it... ;-)

While I generally try to contribute (e.g. fix, new functionality, system plugin), I cannot commit time for this one unfortunately.

@azeey azeey moved this from Inbox to To do in Core development Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: To do
Development

No branches or pull requests

2 participants