By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,776 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,776 IT Pros & Developers. It's quick & easy.

Permission Denied

rajiv07
100+
P: 141
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

Expand|Select|Wrap|Line Numbers
  1. #!C:\Program Files\SWsoft\Plesk\Additional\Perl\bin\perl.exe
  2. use CGI::Carp 'fatalsToBrowser';
  3. use strict;
  4. use warnings;
  5. use CGI;
  6.  
  7. my $file="C:/Inetpub/vhosts/imi.in/cgi-bin/elearning/query/1.html";
  8.  
  9. chmod(0755,'C:/Inetpub/vhosts/imi.in/cgi-bin/elearning/query/');
  10.  
  11. open(FH,">$file") or die $!;
  12.  
  13. print FH "Rajiv";
  14.  
  15. close(FH);
  16.  
  17. open(FH,"$file") or die $!;
  18.  
  19. my @array=<FH>; 
  20.  
  21. close(FH);
  22.  
  23. print "Content-type:text/html\n\n";
  24.  
  25. print "Value=@array";
  26.  
  27. exit;
I am using Windows 2003 IIS 6.0 and Perl 5.8.8

my error


Permission denied at C:\Inetpub\vhosts\imi.in\cgi-bin\elearning\query\file_test.pl line 9.

Please help on this

Regards
Rajiv
Jun 24 '08 #1
Share this Question
Share on Google+
1 Reply


numberwhun
Expert Mod 2.5K+
P: 3,503
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
Jun 24 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.