jettero has asked for the wisdom of the Perl Monks concerning the following question:

I actually asked this question on the par-perl mailing list. But that list doesn't get a lot of traffic. If any PAR fans know how to deal with this:
$ pp -r example.pl Error in tempfile() using /tmp/par_priv.9899.tmp/XXXXXXXXXX.so: Parent + directory (/tmp/par_priv.9899.tmp/) is not a directory at ../blib/li +b/PAR/Heavy.pm line 79 Compilation failed in require at script/example.pl line 4. BEGIN failed--compilation aborted at script/example.pl line 4.

I'd feel most enlightened by your comments...

Actualy mailing list question: http://nntp.x.perl.org/group/perl.par/304

Edit by tye, PRE -> CODE

Replies are listed 'Best First'.
Re: PAR tempfile issue
by RMGir (Prior) on Jul 24, 2003 at 16:47 UTC
    I'm not a PAR user, but I'll throw out a couple of wild guesses (I'm assuming from the .so and /tmp that you're running some Un*x flavour or other...):

    /tmp isn't there/isn't writeable? Maybe the /tmp directory isn't named /tmp, on your system, or the permissions are odd...

    /tmp is full? Maybe you're out of /tmp space, or have exceeded some quota. (Before someone points out that "out of /tmp is also out of swap", that's not necessarily true on all systems.)

    What happens if you mkdir /tmp/xxx? Does the directory get created properly?

    I hope this helps...
    --
    Mike

      Nope... it's not a perms or directory issue or anything. It's something I'm doing wrong with the pp app. Try it yourself, it's kinda neat.

      perl -MCPAN -e 'install PAR' should be trivial.

      pp -r -e 'print "hello world!\n"' should make an executable that's like a meg big ... but it prints hello world and you don't need to have perl installed to run it.

      The problem comes in when I try to make an executable from an app that uses Curses::UI. I don't know why that's special, but it doesn't seem to work -- resulting in the tempfile issue above. I also compiled an app that uses a few modules like Crypt::Rot13 that DID work just fine.

Re: PAR tempfile issue
by vek (Prior) on Jul 25, 2003 at 12:20 UTC

    Line 79 of Heavy.pm is attempting to create a temporary file using tempfile() in File::Temp. If memory serves, tempfile() will not create a directory if it doesn't already exist (that's what tempdir() is for). So File::Temp appears to be complaining here:

    unless (-d $parent) { ${$options{ErrStr}} = "Parent directory ($parent) is not a directo +ry"; return (); }
    Line 79 of Heavy.pm:
    if ($ENV{PAR_CLEARTEMP}) { ($fh, $filename) = File::Temp::tempfile( DIR => ($ENV{PAR_TEMP} || File::Spec->tmpdir), SUFFIX => ".$dlext", UNLINK => ($^O ne 'MSWin32'), ); }

    Hmm, looks like Heavy.pm is telling File::Temp to create a file in the $ENV{PAR_TEMP} directory which is where your problem lies as $ENV{PAR_TEMP} obviously doesn't exist.

    Can't really help you out any more than that as I know little/nothing about PAR and why/how $ENV{PAR_TEMP} is created/used etc...

    -- vek --
Re: PAR tempfile issue
by jettero (Monsignor) on Jul 31, 2003 at 15:48 UTC
    case anyone finds this thread later... the solution was an upgrade to 0.71 -- which wasn't released at the time of the posts above.