Gossamer Forum
Home : Products : DBMan : Discussions :

Random Text File

Quote Reply
Random Text File
I am using the print mod where you can send search results to a text file. I want to make each text file unique to the login user. the command I am using is
open (TEXT, ">data/text.txt")

I would like to change text to something unique each time it is called. Is there a random number mod or something that can be called? and how would I use it in this case? something like "text+random.txt"



Last edited by:

rcook1959: Mar 3, 2005, 11:03 AM
Quote Reply
Re: [rcook1959] Random Text File In reply to
Figured it out used the following:

$values=int(rand(1000)) + 1;

open (TEXT, ">data/$values.txt")

Now does anyone know how to delete these files after the user signs off? if not, I am looking at having to delete files from the data directory on a regular basis.