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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old December 30th, 1999, 01:25 PM
bag
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Im using the GD.pm library to greate some dynamic graphics. I've got the graphics working but I can't get the open() function to save the genrated graphic to the right directory. It will save to the working directory which is /cgi-local but I want it to go in my /webdesign/images directory.

this works:

$gif_data = $image->gif;
open (GIF,'>pic.gif') | | die;
print GIF $gif_data;
close GIF;

it creates the file pic.gif in my cgi-local directory


but if I try:

$gif_data = $image->gif;
open (GIF,'>/webdesign/images/pic.gif') | | die;
print GIF $gif_data;
close GIF;

It bombs on me.

I tried working through the documentation on perl.org but found it very confusing.

I'm just learning so I apologise for bombarding the forum with questions.

I really appreciate all the help everyone has provided.

BAG

Reply With Quote
  #2  
Old December 30th, 1999, 05:40 PM
cbolt
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Define 'bombs'... what error does it give you?

You must make sure that your /webdesign/images directory is chmoded to 777 so it has permission to create a file there. At a shell prompt, type the following:

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>cd /webdesign
chmod 777 images[/quote]

And that should give it the required permissions...

Reply With Quote
  #3  
Old December 30th, 1999, 06:49 PM
bag
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Internal Server Error.


Reply With Quote
  #4  
Old December 31st, 1999, 06:21 AM
cbolt
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Can you find out what error you get by running it manually by telnetting to the server and running perl yourscript.pl? That should give you a much more descriptive error message. If you can't do that, try chmoding the images directory to 777 (you should be able to do this with your FTP client, something like "Change Permissions")

Reply With Quote
  #5  
Old January 14th, 2000, 03:27 PM
skate_punk skate_punk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Posts: 4 skate_punk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
um...
instead of your current code:
open (GIF,'>/webdesign/images/pic.gif') | | die;

try something like this?
open (GIF,'>../webdesign/images/pic.gif') | | die;

i've had problems like that.
just cruise directly to it?
???
just a thought?


----------------------------------

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by cbolt:
Define 'bombs'... what error does it give you?

You must make sure that your /webdesign/images directory is chmoded to 777 so it has permission to create a file there. At a shell prompt, type the following:

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>cd /webdesign
chmod 777 images[/quote]

And that should give it the required permissions...
[/quote]


Reply With Quote
  #6  
Old January 15th, 2000, 05:33 PM
Imo Imo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 1999
Posts: 33 Imo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Off topic a little, are the images coming out fine? Even without going into binmode to write the file? (I don't know the GD.pm module)

[This message has been edited by Imo (edited January 15, 2000).]

Reply With Quote
  #7  
Old January 16th, 2000, 01:10 PM
bag bag is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Posts: 1 bag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Imo. The images come out fine GD.pm is pretty easy to use.

I got it working actually, I forgot to put the .. before the path. I'm an idiot.

Thanks for everyone's help.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > The open() function is driving me nuts!!


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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