http://www.perlmonks.org?node_id=443042


in reply to Strange "There is not enough space on the disk" error (Win32)

cmd.exe has some issues with shell redirection and pipes if the file is not an executable program or a batch file.

Wrap your sample script using pl2bat, and that error goes away.

Hope this helps with your original problem as well... Sample output:

C:\S\temp>test.bat > test.txt C:\S\temp>type test.txt Volume in drive C is Main Volume Serial Number is 280A-19E0 Directory of C:\S\temp 01/07/2004 02:10p <DIR> . 01/07/2004 02:10p <DIR> .. 10/09/2003 04:24p 193 two.lol 12/13/2003 11:46p 65,230 314563.lol 03/28/2005 09:01p 481 test.bat 03/28/2005 09:14p 0 test.txt 4 File(s) 65,904 bytes 2 Dir(s) 11,755,111,424 bytes free

Replies are listed 'Best First'.
Re^2: Strange "There is not enough space on the disk" error (Win32)
by bgreenlee (Friar) on Mar 29, 2005 at 07:42 UTC

    Do you have any info on the nature of cmd.exe's issues? I'm just really curious now as to what the underlying issue is.

    pl2bat does work, although it's essentially just calling "perl test.pl", which I already know works. What I don't understand is, assuming you've got your .pl file association set up, what's the difference between just calling "test.pl", and "perl test.pl"?

    The only thing I can think of is that when you force Windows to go out and find the associated program, it launches it in its own console rather than the existing one, and you somehow don't have access to that console's stdout (although you still get the output in your console, so...). Silly Windows.

    -b

      Do you have any info on the nature of cmd.exe's issues?
      I wish I did. Here's what perldoc pl2bat has to say about it:
      ---8<--- 4 C:> ftype Perl=perl.exe "%1" %* C:> assoc .pl=Perl then C:> script.pl [args] 5 C:> ftype Perl=perl.exe "%1" %* C:> assoc .pl=Perl C:> set PathExt=%PathExt%;.PL then C:> script [args] ---8<--- 4 and 5 work on some Win32 operating systems with some command shells. One major disadvantage with both is that you can't use them in pipelin +es nor with file redirection. For example, none of the following will wor +k properly if you used method 4 or 5: C:> script.pl <infile C:> script.pl >outfile C:> echo y | script.pl C:> script.pl | more This is due to a Win32 bug which Perl has no control over. This bug is the major motivation for pl2bat [which was originally written for DOS] being used on Win32 systems.
      To paraphrase, it doesn't work because it doesn't work. ;)

      All I can see (from this and some searching of MSDN) is that redirection and pipes break when you use ftype and assoc to run a script. I have never seen a why. It's useful information, just not very informative.