[TxMt] bundle temporary directory

Allan Odgaard throw-away-1 at macromates.com
Thu Apr 26 18:43:06 UTC 2007


On 26. Apr 2007, at 17:41, Jay Soffian wrote:

> [...] Anyway, I'm wondering if it might be useful for:
>
> a) All TextMate bundles to use a standard per-bundle temporary  
> location.
> b) For TextMate to create the top of this location at start and  
> clean it up at quit.

Commands should generally use mktemp to create their temporary files.

The added UID or user name is to prevent files from clashing with  
other users, but that’s not a problem when using mktemp. And since OS  
X is primarily a one-user system, keeping temporary files categorized  
by user is IMO not a big priority (TM commands that use temporary  
files SHOULD (though I would like to say MUST) cleanup their  
temporary files).

> [...]
> Useful or not worth the trouble?

mktemp will use TMPDIR [1] (if set). So in practice we could set  
TMPDIR in bash_init.sh (granted, this would only be for shell commands).

But the only value I see in this is, to better pinpoint bundles that  
do not cleanup after themselves.


[1] Unfortunately some bundles does (IIRC) need to use mktemp with an  
absolute path, those ought to use "${TMPDIR:-/tmp}" for where to  
place the file though (not sure if they do).




More information about the textmate mailing list