Permission Denied

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajiv07
    New Member
    • Jun 2007
    • 141

    #1

    Permission Denied

    Hi to all,

    I have a simple script to write something in to a file and read from the file.But it gives Permission Denied error

    My Script

    [CODE=perl]#!C:\Program Files\SWsoft\Pl esk\Additional\ Perl\bin\perl.e xe
    use CGI::Carp 'fatalsToBrowse r';
    use strict;
    use warnings;
    use CGI;

    my $file="C:/Inetpub/vhosts/imi.in/cgi-bin/elearning/query/1.html";

    chmod(0755,'C:/Inetpub/vhosts/imi.in/cgi-bin/elearning/query/');

    open(FH,">$file ") or die $!;

    print FH "Rajiv";

    close(FH);

    open(FH,"$file" ) or die $!;

    my @array=<FH>;

    close(FH);

    print "Content-type:text/html\n\n";

    print "Value=@arr ay";

    exit;[/CODE]

    I am using Windows 2003 IIS 6.0 and Perl 5.8.8

    my error


    Permission denied at C:\Inetpub\vhos ts\imi.in\cgi-bin\elearning\q uery\file_test. pl line 9.

    Please help on this

    Regards
    Rajiv
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Being you are on a Windows system, I don't know that you can use the Unix chmod() function in a Windows environment as I don't know that the Windows system can comprehend the way it sets permissions.

    Typically, when you edit a file in Windows, you don't have to worry about the permissions as such, unless the file is specifically Read Only, but unless the file came from a CD or you specifically set it to be so, you shouldn't have to worry about that.


    Regards,

    Jeff

    Comment

    Working...