Opened 13 years ago

Closed 11 years ago

#1953 closed Bug (Rejected)

FileExists returns 1 for non existing path

Reported by: danbu Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: FileExists Cc: danbu@…


Function FileExists returns 1 instead of 0 for strings consisting of any combination of dots and spaces, which contains at least one dot. For example: ".. ..", " . . ", ". . . . .", "...............................".
If I add a path in the begining it also works: "c:\......", "c:\windows\ ...".

Of course only one and only two dots (".", "..") are correct file names.

Function FileGetTime with the same argument returns an error for all above path except '.' and '..'.

I have used Autoit and beta under Windows XP Pro, Windows Vista Enterprise, Windows Server 2003, all 32-bit. This bug concerns both AutoIt3 and Aut2Exe. I ran this script in several previous version of AutoIt with the same result.

There is a cource code to show this bug.

Dim $file_ok
Dim $file_err
Dim $file_time
Dim $file=''

Dim $array[6]
Dim $num=6
$array[3]='. . .'
$array[5]='c:\windows\   ...'

for $i=0 to $num-1 step 1
  If FileExists($file) Then
    $file_ok = $file_ok & @CRLF & 'name: "' & $file & '", attr: ' & FileGetAttrib ($file) & '", time: '
    $file_time = FileGetTime ($file,0,1)
    if @error=0 then
      $file_ok = $file_ok & $file_time
      $file_ok = $file_ok & 'ERROR'
    $file_err = $file_err & @CRLF & '"' & $file & '"'
  $file = $file & '.'

if $file_ok<>'' Then MsgBox(0,"OK","Files which exist: " & $file_ok)
if $file_err<>'' Then MsgBox(16,"Error","Files which doesn't exist: " & $file_err)

Attachments (0)

Change History (2)

comment:1 Changed 12 years ago by trancexx

Quick code review indicates that there could be problems with FileGetTime and related functions.
Additional problem seems to be file system redirector.

comment:2 Changed 11 years ago by Jon

  • Resolution set to Rejected
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.