[haiku] Re: TEMP directory

  • From: Roland Plüss <roland@xxxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Sun, 11 Oct 2009 12:22:55 +0200


François Revol wrote:
>> On Sat, Oct 10, 2009 at 12:57 PM, Michel Clasquin-Johnson
>> <clasqm@xxxxxxxxx> wrote:
>>     
>>> Does Haiku have a dedicated temporary directory that automatically 
>>> gets
>>> cleaned up at shutdown? You know, like C:\WINDOWS\TEMP or /var/tmp?
>>>
>>> Thanks in advance
>>> Michel
>>> ---------------------
>>> Michel Clasquin-Johnson
>>> e-mail: clasqm@xxxxxxxxx
>>> website: http://www.reviewcentral.co.za/
>>>
>>>
>>>       
>> use:
>> FINDDIR -l
>> on the command line to see the list of directories, running "finddir
>> B_COMMON_TEMP_DIRECTORY" returns what you are looking for.
>> It gives /boot/var/tmp here.  If you are writing a script, you can 
>> use
>> finddir, if you are writing a program use find_directory():
>> http://www.haiku-os.org/legacy-docs/bebook/BDirectory.html#find_directory
>>     
>>> This is the preferred method, avoid using hardcoded paths where 
>>>       
>> possible.
>>     
>
> Right, though for that one if you just want to write portable code it 
> is probably safe to assume /tmp.
>
> François.
>
>   
Why do you have to access tmp directly anyways? To use temporary files
there are POSIX functions to do so which are platform independent.

-- 
Yours sincerely
Plüss Roland

Leader and Head Programmer
- Game: Epsylon ( http://epsylon.rptd.ch/ ,
http://www.moddb.com/games/4057/epsylon )
- Game Engine: Drag(en)gine ( http://dragengine.rptd.ch ,
http://www.moddb.com/engines/9/dragengine )
- Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php )

Other related posts: