[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Commit 3144

On Sat, Dec 3, 2011 at 5:49 AM, David A. Bandel <..hidden..> wrote:
> Just looking at commit 3144:
> if(-d "$tempdir"){}
> else
> {
> my $rc=system("mkdir -p $tempdir");#TODO what if error?
> seems to me, if we have an error creating a tempdir, we have a larger
> problem, i.e., the filesystem where we want to create the tempdir is
> mounted read-only or we don't have write permissions (which should
> never happen in /tmp).
> how about something like:
> (-d $tempdir){ (-w $tempdir) || die "$tempdir not writable"; } ||
> system("mkdir -p $tempdir") || die "cannot create $tempdir";

Works for me.   The only comment I have is that the -p flag is neither
necessary nor supported on Win32.    We should find a way to handle
this.  If nobody else does, I will look into that tomorrow am.

Best Wishes,
Chris Travers