Normally, I would run Apache / Perl (aka an offline development area) and have never had any probs. But now I am trying to create a 'standalone' that will work via PERL only.

First problem. The other day, I discovered that whilst I could read files, I couldn't write or append files using the 3 option version:

open my $fh, '>', 'path to windows folder'; write $fh 'This is a test'; close ($fh)

Today, moved onto read/write directories. Again, eventually, was able to read a directory ... but no way will it create one:

# $schoolName and $bar are set elsewhere, but basically 'AHS' and 'XYZ +' # hotBase is "D:/home/cristofa/public_html/'; $pupilFolder=$schoolName.$bar; # Create the pupil folder for late +r offline use $dirPath=$hotBase.'pupils/'.$pupilFolder; if (-e $dirPath){ print 'already made'; } else{ mkdir $dirPath,0777; print $dirPath; }

But here's an interesting aside. When I use the same path to create it again ... it tells me it already exists even though directory is empty, (even DIR shows an empty folder)

This is being executed from CMD, and the version is 5.20.xx (Ran into problems trying to update Strawberry Perl

On Windows, all users / admin have full rights (it's only me) Although on folder properties, the box beside folders is shown blue. I have unhighlighted that, it runs through all the files in folder ... then directory is STILL shown as Read Only, (but that appears to be same on every other folder on PC)

** Just had a thought. I wonder if my Comodo firewall is preventing files being written out


In reply to Win7 cannot MKDIR or write by cristofayre

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.