Creating temporary files
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Creating temporary files

From: <opaquay@gillam-fei.be>
Date: Tue Dec 20 2005 - 10:37:50 CET

Hello,

I wrote a Tcl app using temporary files. This app needs to run either
in Windows or Linux.

Entry http://wiki.tcl.tk/772 gives perfect hints on how to find a valid
directory to store temporary files.

My app makes connections to a remote server using sockets ...

Since many instances of this app may run on the same machine, how can i
generate distinct sets of temp files ?

If i write the following code :

set my_server_socket [socket $server_ip $server_port]

Can i use safely my_server_socket to generate temporary filenames such
as

file_${my_server_socket}1
file_${my_server_socket}2
...
file_${my_server_socket}16

and assume that temporary file names for 2 concurent apps won't clash ?

Thank you for any idea.
Received on Fri Dec 23 19:02:24 2005