(WIP) Store temp files in /tmp/vimclip/ (Close #5)#8
(WIP) Store temp files in /tmp/vimclip/ (Close #5)#8cjbassi wants to merge 5 commits intohrantzsch:masterfrom
Conversation
|
I like the idea of causing less clutter. I think we need to value |
vimclip
Outdated
| fi | ||
|
|
||
| TMP=$(mktemp -t vimclip) | ||
| mkdir -p /tmp/vimclip |
There was a problem hiding this comment.
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.
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.
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.