TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Erik Huelsmann
from: Miha Valencic
date: 1995-02-08 09:18:56
subject: looking for routine to generate completely unique filenames

Erik Huelsmann wrote in a message to all:

 EH> Is there anyone out there who has a routine to generate
 EH> completely unique filenames??

There is a builtin function to create a unique filename... 
(actually, there are two in C Set) tmpnam & _tempnam. 

 EH> I had an idea to do so, but it doesn't fit into the 8.3
 EH> naming convention! 

 EH>  
 EH>  
 EH>   

You can, on the other hand write your own. If you are limited to 8+3
filename, you can do this:
Date&Time&random
22011435.7642

where date is day,month, time is hour, minute..
or
you can calculate the CRC of time or date or sth.... 

 EH> called within the same 100th (which is very well possible
 EH> with P60/P90-systems and even is possible on my DX2-66). 

In that case, you should check as well for the filename (with access
function for example). I think tmpname functions are limited to 25 files or
so... I'm not sure though.

 EH> So, if anyone has an algorithm for this outthere... please.
 EH> CU,

CRC of time in that case would be the most secure way in my opinion. 

\M 
--- timEd/2 1.01.g3+
* Origin: Iron Fist (2:380/106.10)
SEEN-BY: 12/2442 620/243 624/50 632/348 640/820 690/660 711/409 410 413 430
SEEN-BY: 711/807 808 809 934 942 949 955 712/515 713/888 800/1 7877/2809
@PATH: 380/106 240/5500 396/1 3615/50 229/2 12/2442 711/409 808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.