samwyse has asked for the wisdom of the Perl Monks concerning the following question:
I need to create a temp file. Here's my straightforward code:
When I run it, I get this:my $fh = File::Temp->new(); $fh->autoflush(1); foreach my $cmd (@_) { print "$cmd\n"; print $fh "$cmd\n"; } system "dir $fh";
Why is my file showing up with zero bytes? I've tried using flush at the end of the loop, and sleeping 10 seconds for the OS to catch up, but it keeps acting the same. Did I miss something obvious in the docs? Many thanks for any assistance.C:>brocade.pl supportsave -n -h 10.250.17.140 -d /incoming/50798070 -l ftp exit Volume in drive C has no label. Volume Serial Number is 32B6-C79A Directory of C:\DOCUME~1\dentos\LOCALS~1\Temp 11/30/2012 05:16 PM 0 vfmhcyNzQN 1 File(s) 0 bytes 0 Dir(s) 783,720,448 bytes free
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: File::Temp acting strange under Windows XP (close)
by tye (Sage) on Dec 01, 2012 at 01:02 UTC | |
by samwyse (Scribe) on Dec 01, 2012 at 23:23 UTC | |
Re: File::Temp acting strange under Windows XP
by Kenosis (Priest) on Dec 01, 2012 at 00:14 UTC |
Back to
Seekers of Perl Wisdom