-
Notifications
You must be signed in to change notification settings - Fork 5
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
(WIP) Store temp files in /tmp/vimclip/ (Close #5) #8
base: master
Are you sure you want to change the base?
Conversation
I like the idea of causing less clutter. I think we need to value |
vimclip
Outdated
@@ -11,7 +11,8 @@ if [ "Darwin" = $(uname -s) ]; then | |||
exit 1 | |||
fi | |||
|
|||
TMP=$(mktemp -t vimclip) | |||
mkdir -p /tmp/vimclip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the mac machine I tested, $TMPDIR is not /tmp. So this doesn't work.
mkdir -p $TMPDIR/vimclip
mktemp -t vimclip/vimclip
should work, but I don't know if we can assert $TMPDIR to be set. Probably we need to check it first and default to /tmp if it isn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added a check for $TMPDIR
and defaulted to /tmp
if it's unset. Let me know if it works for you now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks. Looks like it should work -- I'll be able to test on MacOS tomorrow again. Could you do the same check for $TMPDIR
on Linux?
Bad news. I tested again on MacOS and it turns out that before evaluating TMPDIR it claims to look at _CS_DARWIN_USER_TEMP_DIR in the man page of mktemp. However, I wasn't able to make it use another directory by setting either _CS_DARWIN_USER_TEMP_DIR nor TMPDIR. Instead, mktemp seems to get the place where it creates the temp-file from |
Yah that's sounds pretty messy. So I did some quick searching and it seems like $TMPDIR is automatically set, probably by the configuration option you mentioned. So even though configuring the tempdir location can be difficult, it sounds like $TMPDIR should point to the right tempdir folder, in which case it should be fine to use I think. At least that's what it sounded like base on this. edit: I don't have a mac tho, so let me know if any of that seems wrong. |
This works on Linux, but I'm not sure about OSX since I don't have a mac to test on and the mktemp documentation I found online didn't provide much info.