Hi Perl Monks,

I'm trying to sort a large file using the cygwin sort (so maybe this question should be rather addressed to a cygwin forum, but I don't actually think that it is a cygwin problem). As the file is much larger than can fit in memory, I set the directory where cygwin should store any sorted runs temporarily. As I like to keep my tmp directory small (I think /tmp is just a waste of space in most cases), I typically set that directory to `pwd`. This works for the cygwin internal version of perl:
$ perl -e 'system "sort -T `pwd` --buffer-size=10 ../somefile.txt"' | +head
But fails for an external installation of perl (I also tried the external 32 bit version, which fails just the same):
$ /cygdrive/c/Perl64/bin/perl -e 'system "sort -T `pwd` --buffer-size= +10 ../somefile.txt"' | head sort: cannot create temporary file: `pwd`/sort1JB3UE: No such file or +directory
The perl versions are:
$ perl --version This is perl, v5.8.8 built for cygwin-thread-multi-64int (with 8 registered patches, see perl -V for more detail) Copyright 1987-2006, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. $ /cygdrive/c/Perl64/bin/perl --version This is perl, v5.10.0 built for MSWin32-x64-multi-thread (with 3 registered patches, see perl -V for more detail) Copyright 1987-2007, Larry Wall Binary build 1002 [283697] provided by ActiveState http://www.ActiveSt +ate.com Built Jan 10 2008 10:53:05 Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge.
Any explanation and/or work arounds (other than increasing /tmp) would be much apcodeciated!
Thank you,
bop

In reply to sort system call problem with activestate perl by bop

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.