in reply to mkdir() problem on windows

One way is to run DOS attrib command from your perl. Look up attrib command.

Peter (Guo) Pei

Replies are listed 'Best First'.
Re^2: mkdir() problem on windows
by myuserid7 (Scribe) on Nov 20, 2010 at 23:06 UTC

    Thanks for the quick reply!

    I tried this out, but it seems not to work, at least not in my case

    D:\dev\perl>perl -e "mkdir('test');" D:\dev\perl>attrib test D:\dev\perl\dirtreeByTag\test

    DOS attrib shows no +R (the flag for read-only) - but the Windows property Dialog shows "semi-checked" checkbox for write protection (meaning the background of the box is gray, but it is checked)

    I Think this must mean that there are differences between the DOS-available attributes and the ones windows sets...

    I will look further with this information and let you know if I find something.

    In the mean time I'm looking forward for any other answers, as everybody here does always ;-)

    greetings to all of you

Re^2: mkdir() problem on windows
by myuserid7 (Scribe) on Nov 20, 2010 at 23:56 UTC

    I now tried to fix it with Win32::File::Object - and found out that I indeed can set and unset attributes like HIDDEN but whatever I try it does not work for READONLY

      Well... at least not for directories, as I found out now. With regular files all works just fine...

      Could this be a bug in the Win32::File / Win32::File::Object Module?