Modify

Opened 17 years ago

Closed 17 years ago

#690 closed Bug (No Bug)

Problems with Run and chkdsk

Reported by: anonymous Owned by: Valik
Milestone: Component: AutoIt
Version: 3.2.12.1 Severity: Blocking
Keywords: Cc:

Description (last modified by Valik)

I updated to the latest Public (3.2.12.1). I've got problems with chkdsk and Run or StdoutRead.
The following script return not correct return data.
If I change "chdsk" to "sort" the returned data is correct!

I'm I still doing it wrong ?
But were is the misstake?

#include <Constants.au3>

Local $foo, $cmd
Local $line
;$cmd = @ComSpec & " /c chkdsk F: /f/r"
$cmd = @ComSpec & " /c chkdsk /?"

$foo = Run($cmd, @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

dbg($foo)
dbg($cmd)
While 1

    $line = StdoutRead($foo)
    If $line<>"" Then

        dbg("StdoutRead: " & $line)

    EndIf
    If Not ProcessExists($foo) Then

        ExitLoop

    EndIf

Wend

Exit

Func dbg($msg, $error=@error, $extended=@extended, $ScriptLineNumber=@ScriptLineNumber)

    Local $out = "(" & $ScriptLineNumber & ")(" & $error & ")(" & $extended & ") := " & $msg
    ;Output to application attaching a console to the script engine
    ConsoleWrite($msg & @CRLF)
    ;Output to debugger (dbgview.exe)
    DllCall("kernel32.dll", "none", "OutputDebugString", "str", $out)

EndFunc

Attachments (0)

Change History (3)

comment:1 by Valik, 17 years ago

Description: modified (diff)

The code worked in a previous version I take it?

comment:2 by Valik, 17 years ago

Owner: set to Valik
Severity: NoneBlocking
Status: newassigned

comment:3 by Valik, 17 years ago

Resolution: No Bug
Status: assignedclosed

There's no bug here. You're running the code from SciTE or another editor. Editors change the behavior of using STDIO redirection. Run the script compiled and it will work correctly, aside from some obvious issues in the code itself (Hint: Just because the process ends doesn't mean there's not data to read).

Anyway, no bug.

Modify Ticket

Action
as closed The owner will remain Valik.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.