Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Why I get a display "Access is denied" when i run my perl script on my pc?

by fizbin (Chaplain)
on Jan 20, 2007 at 13:17 UTC ( [id://595662]=note: print w/replies, xml ) Need Help??


in reply to Why I get a display "Access is denied" when i run my perl script on my pc?

I've gotten this error sometimes when the perl script has been transferred to the machine with cygwin tools. (e.g. cygwin ssh, ftp, or wget)

The issue is that somehow you've managed to get the "execute" permission turned off on that file. This is very unusual on windows, but it's often the normal situation on unix; hence, I've only ever encountered it when I've pulled down a file with cygwin, which emulates a unix environment on windows.

In any case, the way to fix this if you have cygwin installed is to do chmod a+x filename.pl. If you don't have cygwin, then I'm puzzled as to how you managed to do this to yourself, but you can fix it by right-clicking on the file in an explorer window, choosing "Properties", then the "Security" tab, then "advanced". When you see the list of "permission entries", choose the one corresponding to your user id, hit "Edit", and make sure that the "Traverse Directory/Execute" permission is enabled.

If you are unable to find the problem by looking at your perl script, the problem may be with perl itself. Did you perhaps install Perl by unpacking the zip file with cygwin's unzip? If so, you'll have to make sure that you grant yourself execute permission to basically everything in your perl directory (setting permissions explicitly on the perl directory will give you a chance to automatically apply the permissions all the way down). You can check if the problem is perl itself by seeing if perl scriptname.pl works. If that doesn't work, then the problem is with the permissions on perl.

If you're still having trouble, could you tell us:

  1. Whether perl scriptname.pl works (or what error message it gives if it doesn't)?
  2. What cacls scriptname.pl shows?
--
@/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/

Replies are listed 'Best First'.
Re^2: Why I get a display "Access is denied" when i run my perl script on my pc?
by Anonymous Monk on Jan 22, 2007 at 22:37 UTC

    Hi,

    I did unzip all my perl file by using cygwin. But when i ran perl my.pl, it worked.

    the result for executing the cacls my.pl is:

    Microsoft Windows XP Version 5.1.2600

    C:\Mc2_v2\Metcalf1\bin>cacls metcalf.pl

    C:\Mc2_v2\Metcalf1\bin\Metcalf.pl WTAM\cxu:(special access:)

    STANDARD_RIGHTS_ALL

    DELETE

    READ_CONTROL

    WRITE_DAC

    WRITE_OWNER

    SYNCHRONIZE

    STANDARD_RIGHTS_REQUIRED

    FILE_GENERIC_READ

    FILE_GENERIC_WRITE

    FILE_READ_DATA

    FILE_WRITE_DATA

    FILE_APPEND_DATA

    FILE_READ_EA

    FILE_WRITE_EA

    FILE_READ_ATTRIBUTES

    FILE_WRITE_ATTRIBUTES

    BUILTIN\Users:(special access:)

    READ_CONTROL

    SYNCHRONIZE

    FILE_GENERIC_READ

    FILE_READ_DATA

    FILE_READ_EA

    FILE_READ_ATTRIBUTES

    Everyone:(special access:)

    READ_CONTROL

    SYNCHRONIZE

    FILE_GENERIC_READ

    FILE_READ_DATA

    FILE_READ_EA

    FILE_READ_ATTRIBUTES

    Thanks,

    Cindy

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-29 11:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found