Modify

Opened 11 years ago

Closed 11 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 Changed 11 years ago by Valik

  • Description modified (diff)

The code worked in a previous version I take it?

comment:2 Changed 11 years ago by Valik

  • Owner set to Valik
  • Severity changed from None to Blocking
  • Status changed from new to assigned

comment:3 Changed 11 years ago by Valik

  • Resolution set to No Bug
  • Status changed from assigned to closed

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.

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

Action
as closed The owner will remain Valik.
Author


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

 
Note: See TracTickets for help on using tickets.