cristofayre has asked for the wisdom of the Perl Monks concerning the following question:
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Win7 cannot MKDIR or write
by dave_the_m (Monsignor) on Mar 05, 2019 at 13:37 UTC | |
Re: Win7 cannot MKDIR or write
by thechartist (Monk) on Mar 05, 2019 at 19:34 UTC |