Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 11th, 2001, 01:04 PM
crash_nic crash_nic is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 14 crash_nic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Tie Statement Dies with "Permission denied"

Why does this script always die with a "Permission denied" message?

#!/usr/bin/perl

use strict;
use DB_File;
use vars qw(%h $k $v);

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

tie %h, "DB_File", "fruit", O_RDWR|O_CREAT, 0777, $DB_HASH or die "Can't open 'fruit':$!\n";
.
.
.

Please help. Thanks!

Reply With Quote
  #2  
Old May 11th, 2001, 04:09 PM
JonLed JonLed is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2000
Location: Indiana
Posts: 614 JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 49 m 49 sec
Reputation Power: 10
Well do you have permission to open 'fruit'?

Reply With Quote
  #3  
Old May 12th, 2001, 10:08 AM
crash_nic crash_nic is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 14 crash_nic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I was told this code would create a db file, but I guess it didn't. Once I created 'fruit' with the necessary permissions, everything worked fine.

Reply With Quote
  #4  
Old May 14th, 2001, 08:01 AM
Dave_L Dave_L is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 4 Dave_L User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 38 sec
Reputation Power: 0
Does DB_File export the symbols O_CREAT and O_RDWR ? Try turning on warnings.

I'm using DB_File, but importing those symbols from Fcntl:

use Fcntl qw(O_CREAT O_RDWR O_RDONLY);

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Tie Statement Dies with "Permission denied"


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway