what would be the c# equivalent of this code snippet?
Posted
by Dervin Thunk
on Stack Overflow
See other posts from Stack Overflow
or by Dervin Thunk
Published on 2010-04-17T21:02:17Z
Indexed on
2010/04/17
21:03 UTC
Read the original article
Hit count: 291
I don't really understand Perl, so I was wondering if someone could give me a hint about what it is this code is asking of STDIN, and how to say this in C#. Thanks.
$TMPFILE = "xxx.tmp";
if (! -f STDIN) {
open TMPFILE, "> $TMPFILE"
or die "Couldn't open `$TMPFILE' for writing: $!; aborting";
print TMPFILE while <STDIN>;
close TMPFILE;
open STDIN, "< $TMPFILE"
or die "Couldn't open `$TMPFILE' for reading: $!; aborting";
unlink $TMPFILE;
}
© Stack Overflow or respective owner