1. uniquefilename.e
- Posted by jxliv7 <jxliv7 at hotmail.com> Mar 30, 2007
- 559 views
- Last edited Mar 31, 2007
I sent Rob a simple 7-character unique filename generator the other day. It was inspired by CChris's recent "unique_filename() function". "uniquefilename.e" is based on the Euphoria date() function -- every second a new name is generated with no repeats -- at least for the next 25 years. There's room for tweaking, so...
while (comments or suggestions) do ? appreciation end while }}} <eucode>
Thanks,
jon }}}
2. Re: uniquefilename.e
- Posted by Chris Burch <chriscrylex at aol.com> Mar 30, 2007
- 561 views
- Last edited Mar 31, 2007
jxliv7 wrote: > > I sent Rob a simple 7-character unique filename generator the other day. It > was inspired by CChris's recent "unique_filename() function". > > "uniquefilename.e" is based on the Euphoria date() function -- every second > a new name is generated with no repeats -- at least for the next 25 years. > > There's room for tweaking, so... > > }}} <eucode> > while (comments or suggestions) do > ? appreciation > end while > }}} <eucode> > > Thanks, > > > -- > jon I wrote a similar type function for compressing backups. When using the dat, be sure to reverse the format, ie yyyymmddhhmmss That way your filename will always be sequential. Chris http://euallegro.wikispaces.com http://members.aol.com/chriscrylex/euphoria.htm http://uboard.proboards32.com/ http://members.aol.com/chriscrylex/EUSQLite/eusql.html
3. Re: uniquefilename.e
- Posted by jxliv7 <jxliv7 at hotmail.com> Mar 31, 2007
- 555 views
Chris Burch wrote: > > I wrote a similar type function for compressing backups. > > When using the dat, be sure to reverse the format, ie > > yyyymmddhhmmss > > That way your filename will always be sequential. > That's what I did. But instead of a "ddmm" or "mmdd" sequence, I used the day of the year ( date[8] ) from the date() function. That's easier to code (and decode) as well as shorter than "mmdd" or "ddmm". The result is [year][day of year][seconds of day] translated into base 26 (A-Z), for a total of 6 characters. Thanks for the comments, -- jon
4. Re: uniquefilename.e
- Posted by jxliv7 <jxliv7 at hotmail.com> Mar 31, 2007
- 586 views
jxliv7 wrote: > > The result is [year][day of year][seconds of day] translated into base 26 > (A-Z), > for a total of 6 characters. ^ Oops, I meant 7 characters... -- jon
5. Re: uniquefilename.e
- Posted by c.k.lester <euphoric at cklester.com> Mar 31, 2007
- 578 views
jxliv7 wrote: > > > The result is [year][day of year][seconds of day] translated into base 26 > > (A-Z), > > for a total of 6 characters. > ^ > Oops, I meant 7 characters... Doesn't seem to be working for me. It's only generating unique filenames every 5-10 seconds.