Menu

#495 SysTempFileName generates identical filenames

3.2.0
closed
nobody
5
2012-08-14
2008-02-20
Anonymous
No

-- ooRexx
say SysTempFileName(Value(TEMP,, "ENVIRONMENT")"FuBar_?????");
say SysTempFileName(Value(TEMP,, "ENVIRONMENT")"FuBar_?????");
say SysTempFileName(Value(TEMP,, "ENVIRONMENT")"FuBar_?????");

D04105641@inbox.lv
2K3 server
Intel Xeon 3.2GHz (2 CPU)

Discussion

  • Jon Wolfers

    Jon Wolfers - 2008-02-23

    Logged In: YES
    user_id=667060
    Originator: NO

    I can confirm that I also see this behaviour (3.2.0 on WXP).

    I'm not sure that this is a bug. The documentation says SysTempFileName
    'Returns a unique name for a file or directory that does not currently exist.'

    The use of the term unique here might be the cause of the confusion. As the OP does not create a file based on the return from the first call, one could consider it valid that sysTempFileName returned the same file name again, because at the time of the call, a file with the first name does not exist.

    hth

    Jon

     
  • Rick McGuire

    Rick McGuire - 2008-02-23

    Logged In: YES
    user_id=1125291
    Originator: NO

    Jon has diagnosed this correctly. The SysTempFileName() function only guarantees that it will return a name for a file that does not exist in the target location. Since this program is not creating the actual temp file, it's bypassing the mechanism used to determine the suitability of the returned name.

     

Anonymous
Anonymous

Add attachments
Cancel