Opened 14 years ago
Closed 14 years ago
#1678 closed Bug (No Bug)
DirCreate() can return 1 (success) without creating any directory
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Milestone: | Component: | AutoIt | |
Version: | 3.3.6.1 | Severity: | None |
Keywords: | Cc: |
Description
AutoIt:3.3.6.1
Os:WIN_XP/X86/Service Pack 3
Language:0409 Keyboard:00000809
Cpu:X64
When DirCreate() is passed certain invalid paths, for example "C:xxx\zzz", it returns 1 indicating success even though no path has been created.
$Result = DirCreate("C:ZZZ\XXX") MsgBox(0,"DirCreate", "DirCreate returned " & $Result)
Attachments (0)
Change History (6)
comment:1 follow-up: ↓ 2 Changed 14 years ago by mvg
comment:2 in reply to: ↑ 1 Changed 14 years ago by Bowmore
Replying to mvg:
NoBug
DirCreate("C:ZZZ\XXX") will actually create the requested folder(s). At the drive root level in your case, so "C:\ZZZ\XXX". So the returned value is correct in this case.
That is not the case on the 3 PC I've tried it on. No directories are created.
comment:3 Changed 14 years ago by mvg
Than a small example script is needed that shows when this is the case.
Using the code you provided is not showing the problem you describe. (at least not on my system) Ergo: NoBug.
If its something OS or PC specific. You need to find out what -> forum being a better place for that.
Just in case. I'm using similar OS specs here, Just not on a 64bit CPU.
comment:4 Changed 14 years ago by Jpm
I cannot reproduce it either.
I don't think it can be related with a 64bit CPU running an X86 Windows
Unless you provide an script that can reproduce it, I am afraid to close it as "Work for me"
comment:5 Changed 14 years ago by Bowmore
I have now found what is happening. The directories are being created, not in the root of the drive but in whatever the working directory happens to be at the time. My expectation was that with a malformed path such as "c:xxx" the directory would not be created or possibly in the root of the drive as suggested by mvg.
FileChangeDir(@TempDir) ;Just to make sure that the drive root is not the working directory $res = DirCreate("C:xxx\yyy\zzz") MsgBox(0,"DirCreate 'C:xxx\yyy\zzz'", "DirCreate returned " & $Res) ;Returns 1 for me $res = FileExists("C:xxx\yyy\zzz") MsgBox(0,"FileExists 'C:xxx\yyy\zzz'", "FileExists returned " & $Res) ;Returns 1 for me $res = FileExists("C:\xxx\yyy\zzz") MsgBox(0,"FileExists 'C:\xxx\yyy\zzz'", "FileExists returned " & $Res) ;Returns 0 for me $res = FileExists(@WorkingDir & "\xxx\yyy\zzz") MsgBox(0,"FileExists '@workingDir & \xxx\yyy\zzz'", "FileExists returned " & $Res) ;Returns 1 for me
Hoverver this replicates what the cmd.exe MD command does, so no bug
comment:6 Changed 14 years ago by Jpm
- Resolution set to No Bug
- 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.
NoBug
DirCreate("C:ZZZ\XXX") will actually create the requested folder(s). At the drive root level in your case, so "C:\ZZZ\XXX". So the returned value is correct in this case.