Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^5: Permission denied writing to Windows 10

by BrowserUk (Patriarch)
on Sep 14, 2016 at 18:47 UTC ( [id://1171758]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Permission denied writing to Windows 10
in thread Permission denied writing to Windows 10

Okay. Now try perl -E"say for 1 .. 10" > hello.txt

And if that works (which it should) then try:

perl -E"open O, '>', 'hello.txt' or die $^E; say for 1 .. 10; close O"

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^6: Permission denied writing to Windows 10
by Anonymous Monk on Sep 14, 2016 at 18:53 UTC

    The first command line worked - I got a file with the integers 1-10.

    However, the second command line failed with the error:

    Access is denied at -e line 1.

      I'm thinking that, for some reason, admin privilege is being dropped when the Perl run time is started. Don't know if MS Windows is doing that or Perl is. My guess would be MS Windows.

      Hm. Does strawberry perl emulate the default chmod thing that *nix uses? Has the default value been set to some weird value?

      Basically, there is something screwed in your perl installation.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.

        I have no idea how to even answer your question! :) That said, I just installed Perl yesterday so I would be shocked if something was screwed up with it already. I am now suspecting something is wrong with my windows installation. If I change the opened file to a different directory (C:\public, for example) it works as expected. I am thinking that there is something about this specific directory tree. Fortunately, reinstalling Windows is painless and always error free. Ugh... Thanks for the help anyway!

        strawberryperl is just perl

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1171758]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-20 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found