[Pharo-users] Temporary files
Cyril Ferlicot Delbecque
cyril.ferlicot at gmail.com
Wed May 11 09:09:50 EDT 2016
On 11/05/2016 15:01, Valentin Ryckewaert wrote:
> Hello everyone,
> I would like to use a temporary file for a project and I didn't find an
> existing method.
> I'm asking my self if it's a better idea to use ffi or OSSubProcess (or
> something already build for it) to build a method able to create this
> tmp file.
> Someone could help me please?
> PS : Should it be a good idea to add this method directly in Pharo ?
For temporary files you can create a new file in memory via `FileSystem
memory` so you do not pollute your file system and the file will be
deleted later since the memory is volatile.
`file := FileSystem memory / 'tmp.txt'.
file writeStreamDo: [ :s | s nextPutAll: 'Hello World' ].`
165 Avenue Bretagne
Lille 59000 France
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 801 bytes
Desc: OpenPGP digital signature
More information about the Pharo-users