wxfield has asked for the wisdom of the Perl Monks concerning the following question:
I have the following code, but can't seem to see anything other than the startup versioning information from diskpart when I print <OUT>. Do I have to flush after I print to the <IN> on Windows?
use FileHandle; use IPC::Open2; my $pid; eval { $pid = open2(\*OUT, \*IN, 'diskpart'); }; if ($@ and $@ =~ /^open2:/) { die "$@:$!\n"; } print IN "list disk"; close IN; while(<OUT>) { print "$line_no: $_"; $line_no++; } close OUT; exit(0);
So far all I get is this..
0:
1: Microsoft DiskPart version 6.0.6002
2: Copyright (C) 1999-2007 Microsoft Corporation.
3: On computer: HITAUTO-2008X86
4:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: open2 with windows diskpart
by ikegami (Patriarch) on Jun 16, 2009 at 23:57 UTC | |
|
Re: open2 with windows diskpart
by BrowserUk (Patriarch) on Jun 17, 2009 at 00:05 UTC | |
by wxfield (Novice) on Jun 17, 2009 at 00:42 UTC | |
|
Re: open2 with windows diskpart
by ikegami (Patriarch) on Jun 17, 2009 at 00:11 UTC | |
by wxfield (Novice) on Jun 17, 2009 at 00:51 UTC | |
by ikegami (Patriarch) on Jun 17, 2009 at 01:59 UTC | |
by Anonymous Monk on Jun 17, 2009 at 02:50 UTC | |
by ikegami (Patriarch) on Jun 17, 2009 at 05:18 UTC | |
|