[Vm-dev] Re: Temp directory for Squeak

K. K. Subramaniam kksubbu.ml at gmail.com
Sat Jun 12 18:50:09 UTC 2010


On Saturday 12 Jun 2010 11:01:41 pm Bert Freudenberg wrote:
> On 12.06.2010, at 17:20, K. K. Subramaniam wrote:
> > Hi,
> > 
> > I propose that we add one more user directory to squeak - a volatile
> > writable directory that can used for temporary files. On most hosts,
> > temporaryDirectory will be mapped to RAM and not hard disk or flash
> > memory. RAM has reduced I/O latency, power drain and wear/tear.
> 
> Would the VM be responsible for deleting that directory when it exits?
Yes. To reclaim tmpfs space. In case of a crash, the host will reclaim the 
same on reboot.
 
> > mktemp family of calls can be used to create it (on first access)
> > portably in both plugin code and in launch scripts.
> 
> What would mktemp have to do with this? You need to pass it the location,
> it just creates a unique file.
mktemp refers to a family of calls. mkdtemp creates a directory. mktemp -d 
creates the same in a script. 
 
> At least on the OLPC XO, the RAM-backed tmp folder may be as small as 1 MB:
> 
> http://wiki.sugarlabs.org/go/Development_Team/Low-level_Activity_API#Writab
> le_Directories
> 
> That does not seem sufficient for "large remote files" or video clips. Or
> even for larger Etoys projects, for that matter.
mkdtemp takes a path. For low-RAM XO models, one could mount/symlink flash 
onto, say, /tmp/squeak/ and use it as a temporary directory for Squeak. Of 
course, the startup scripts will have to wipe /tmp/squeak/ to take care of VM 
crashes.

Subbu


More information about the Vm-dev mailing list