SunQuest
           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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old October 3rd, 2000, 08:29 AM
victha victha is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 4 victha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi,

i have a cgi-script that is suppose to decode a mime-message and write it to a temporary file.
It runs well at the prompt but when i try it through the browser it does not write to the file. I've set debug like this:

unless (open (EP,"/var/tmp/message.msg")) {
print "Cannot access file";
}

and the browser returs Cannot return file.

Can anynone please tell me how to write to a file on the hard disk from the cgi script. and if there are any settings that need to be specified within the cgi script.

Its really urgent thank you;

Reply With Quote
  #2  
Old October 3rd, 2000, 06:37 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: 9
Well you should write it like this:
open(EP,"/var/tmp/message.msg") | | print "Cannot access file - $!";

That's a much better way than an unless statement. Another thing you can do is add a check to see if got access to exists/read/write the file. Exist would be done like this:
unless(-e $file){die "Error Message"}

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > What is needs to be decalred in a cgi script read and write to a file.


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 2 hosted by Hostway