-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fall back to system("mv $tmp $outhome")
when rename()
fails on Linux
#65
Conversation
I just got another insight: #59 broke the client on macOS, because of the wrong name, which can be fixed pretty easily by the change I made in |
Update: I now switched the moving back to |
system("mv $tmp $outhome")
when rename()
fails on Linux
Hi all! This thread has not had any recent activity. |
Hi all! This thread has not had any recent activity. |
Hi all! This thread has not had any recent activity. |
Hi everyone. |
Fixes #64
This issue is actually two issues.
The first one is in
local.h
. We download the filemain.zip
, which contains the directorytldr-main
, but we expecttldr
. This was may fault in #59 (Update: I moved this fix to #66, because it's more urgent.)But this is not the actual issue here. As already explained in #21, Linux mounts
/tmp
on a different filesystem than the rest of the system. We now try to move a file across two filesystems, usingrename()
. This isn't supported and therefore it fails. The solution is to manually copy the directory and delete the old one afterwards.The problem here is, that this is much more complex, than simply calling a function. (Which is probably why #21 didn't get merged). For now I'm simply callingmv /tmp/tldrxxxx/tldr-main ~/.tldrc/tldr
. This works perfectly on Linux and maybe on macOS, but probably not on Windows. This would be an example of a cross-platform copying function.Since that exceeds my C knowledge I'm asking you what to do. Is this client even indented to work on Windows at all?Update: I now switched the moving back to
rename()
and only callsystem("mv $tmp $outhome")
when it fails witherrno == 18
, like #21 attempted. This should not break anything on macOS and fix the issue on Linux.