[squeak-dev] path for volatile files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] path for volatile files

K. K. Subramaniam
Hi,

How can I access a 'temporary directory' in Squeak?  When I run Squeak from
USB flash memory, I don't want temporary files created in the (FileDirectory
default) folder. I wanted a VM-unique volatile path where I can create
temporary files. e.g.
        /tmp/squeakvm-$VMPID/  (Unix)
       C:\WINDOWS\TEMP  (Windows)

Do I hack FileDirectory to create a unique temp directory on startup and clean
the cruft on quit. Is there a better way?

Thanks in advance,
Subbu

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] path for volatile files

keith1y
K. K. Subramaniam wrote:

> Hi,
>
> How can I access a 'temporary directory' in Squeak?  When I run Squeak from
> USB flash memory, I don't want temporary files created in the (FileDirectory
> default) folder. I wanted a VM-unique volatile path where I can create
> temporary files. e.g.
> /tmp/squeakvm-$VMPID/  (Unix)
>        C:\WINDOWS\TEMP  (Windows)
>
> Do I hack FileDirectory to create a unique temp directory on startup and clean
> the cruft on quit. Is there a better way?
>
> Thanks in advance,
> Subbu
>  
Check out Rio as a replacement for FileDirectory, it has:

"To create a new temp directory"

tmp := Rio mkTmpDir

"To clean up everything."

tmp all rmdir.

best regards

Keith

p.s. It doesnt have a clean up on exit, and I havent tested the windows
variant on windows.