Wikia

Vim Tips Wiki

Changes: Recreate tempfile directory

Edit

Back to page

(Assign tip id + convert to TipNew template + minor clean)
 
Line 1: Line 1:
{{TipProposed
+
{{TipNew
|id=0
+
|id=1603
|previous=0
+
|previous=1602
|next=0
+
|next=1604
 
|created=August 27, 2008
 
|created=August 27, 2008
 
|complexity=basic
 
|complexity=basic

Latest revision as of 09:16, April 6, 2009

Tip 1603 Printable Monobook Previous Next

created August 27, 2008 · complexity basic · author Egr10whois · version 7.0


Occasionally, when an editing session is up for several days, but no feature that creates temporary files has been used, some administrative script (especially on multiuser or server systems configured to run for months at a time) may decide that Vim's temporary file directory is stale, because it hasn't been accessed in N days, and remove it.

Unfortunately, Vim's error reporting when this happens may not identify the missing directory path; for example:

:hardcopy
E324: Can't open PostScript output file

Fortunately, it is easy to determine the temporary file directory path:

:echo tempname()
/tmp/v012345/67

or even to recreate it, without ever leaving Vim:

:call mkdir(fnamemodify(tempname(),':h'),'p',0700)

CommentsEdit

Around Wikia's network

Random Wiki