#1159 Stream command "query exists" ans sysfiletree return false positives

v4.2.0
closed
Rick McGuire
None
complete
1
2014-04-15
2013-02-07
mukenx
No

under windows xp, when querying the existence of files using illegal chars in file names, the stream command "query exists" gives false positives when the file without the illegal chars does exist. Same applies to the sysfiletree function.

The following script is the only file in c:\temp\test\:

parse source . . me .
say 'expect file name :'me
say 'expect file name :'.Stream~new(me)~command('query exists')
say 'expect empty string:'.Stream~new(me || '?<>')~command('query exists')
say 'expect empty string:'stream(me || '?<>
', 'command', 'query exists')
call sysfiletree '.?<>', 'files', 'F'
say 'expect file count=0:'files.0
say 'expect uninit var :'files.1


and gives following result:

C:\temp\test>me.rex
expect file name :C:\temp\test\me.rex
expect file name :C:\temp\test\me.rex
expect empty string:C:\temp\test\me.rex?<>
expect empty string:C:\temp\test\me.rex?<>

expect file count=0:1
expect uninit var : 2/07/13 11:22p 385 A---- C:\temp\test\me.rex


C:\temp\test>rexx -v
Open Object Rexx Version 4.1.2
Build date: Aug 28 2012
Addressing Mode: 32

Copyright (c) IBM Corporation 1995, 2004.
Copyright (c) RexxLA 2005-2012.
All Rights Reserved.
This program and the accompanying materials are made available under
the terms of the Common Public License v1.0 which accompanies this
distribution or at
http://www.oorexx.org/license.html

Discussion

  • mukenx
    mukenx
    2013-02-07

    after sending this, I noticed that the 4th illegal char I had also appended is missing: the star character.
    Madou

     
  • Rick McGuire
    Rick McGuire
    2013-11-23

    • status: open --> accepted
    • assigned_to: Rick McGuire
    • Pending work items: none --> code
     
  • Mark Miesfeld
    Mark Miesfeld
    2013-11-28

    • status: accepted --> pending
    • Pending work items: code --> complete
     
  • Mark Miesfeld
    Mark Miesfeld
    2013-11-28

    SysFileTree
    Committed revision 9575. [r9575] code trunk
    Committed revision 9576. [r9576] add basic SysFileTree test group
    Committed revision 9577. [r9577] update doc
    Committed revision 9578. [r9578] code 4.1 fixes

    The Windows API that lists files will not use invalid file name characters. Instead it changes invalid file name characters to '*', '?', and '.' SysFileTree will return an error code and the files stem will have the .0 stem set to 0 if the file spec string has illegal characters in it.

     

    Related

    Commit: [r9575]
    Commit: [r9576]
    Commit: [r9577]
    Commit: [r9578]


Anonymous


Cancel   Add attachments