[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] [commit] Global temp dir, changes to Buffer
Since nobody objected, I've done this.
S.
On 1 Jan 2006, at 13:33, Scott Wilson wrote:
Following the recent discussions about temp files, I propose the following addition to PathName to provide a user-settable global temp directory:
<x-tad-smaller>PathName</x-tad-smaller><x-tad-smaller> { </x-tad-smaller><x-tad-smaller>// AdC, cx</x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller>classvar</x-tad-smaller><x-tad-smaller> <>tmp;
*initClass {
scroot = </x-tad-smaller><x-tad-smaller>File</x-tad-smaller><x-tad-smaller>.getcwd;
tmp = [</x-tad-smaller><x-tad-smaller>"/tmp/"</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>"/WINDOWS/TEMP/"</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>"sounds/"</x-tad-smaller><x-tad-smaller>].detect({ </x-tad-smaller><x-tad-smaller>|path|</x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller>File</x-tad-smaller><x-tad-smaller>.exists(path);
});
tmp.isNil.if(
{</x-tad-smaller><x-tad-smaller>"No valid temp directory found. Please set this manually using PathName.tmp_"</x-tad-smaller><x-tad-smaller>.warn});
}</x-tad-smaller>
All the Buffer methods which write temp files would be changed to use this, as could anything else in the library that writes temp files. The assumption is that OSX and Linux will use tmp by default, Windows will use /WINDOWS/TEMP (can someone let me know if this presents any issues), and sounds/ (which Buffer currently uses) is a last resort.
Failing everything a warning is posted, as requested.
Good?
S._______________________________________________
sc-dev mailing list
sc-dev@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-dev