SCOUG-Programming Mailing List Archives
Return to [ 30 |
August |
2003 ]
>> Next Message >>
Content Type: text/plain
blairra@tstonramp.com wrote:
>
> four characters followed by 5 '?' which generates a 9
> character file name which is invalid on a FAT drive.
I think what happens is that SysTempFileName generates a random number,
then substitutes the digits where it sees a '?' in the filename mask,
then goes to the disk to see if the file already exists (and repeats if
it finds such a filename). Since the FAT driver won't like the name,
you get an error back.
Suggestion #1: Change your
ABCD?????
mask to
ABCD????.?
which should be valid on a FAT drive.
Suggestion #2: Write your own SysTempFileName routine
(BobTempFileName?) and generate a hex random number rather than a
decimal random number to replace the '?' characters. Four hex digits
are equivalent to 0..65535 which is a heck of a lot of files and you
should be okay. If you absolutely must have 100,000 filenames then use
base 18 instead of base 16 (0..H instead of 0..F). By the way, it's
easier to program this routine by generating a random "digit" for each
'?' encountered instead of generating a single random number and then
reducing it to the chosen base. Might be faster, too, since you aren't
doing any base reduction in Rexx's character arithmetic.
/* Create a random digit for the current '?' character. */
c = substr( '0123456789ABCDEFGH', random(1,18), 1 )
I can't remember the Rexx function that expands f('00'h..'11'h) to the
'0123456789ABCDEFGH' character string.
- Peter
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
>> Next Message >>
Return to [ 30 |
August |
2003 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|