Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 10th, 2007, 12:22 PM   #1
Ade
Hobbyist Programmer
 
Ade's Avatar
 
Join Date: Oct 2004
Location: England, UK
Posts: 139
Rep Power: 0 Ade is an unknown quantity at this point
Setting location for a temp file

Hi,

I have got a script to create a temp file using:

($fh, $filename) = tempfile(SUFFIX => '.vcf');

Now you can set the location directory of this file using:

$dir = tempdir( CLEANUP => 1 );
($fh, $filename) = tempfile( $template, DIR => $dir);

But that puts the temp file in a directory in the /tmp directory. Something like:

/tmp/Ir9usvCuAr/GykBOCKgOc

My question is how can I set a directory to hold these new temp files somewhere else in the file structure? Somewhere like /home/me/public_html/thisplace_here/



Thanks for any advice
__________________
Don't wound what you can't kill
Ade is offline   Reply With Quote
Old Oct 10th, 2007, 12:29 PM   #2
Ade
Hobbyist Programmer
 
Ade's Avatar
 
Join Date: Oct 2004
Location: England, UK
Posts: 139
Rep Power: 0 Ade is an unknown quantity at this point
Should have said that just putting the path in $dir just gives an error.

__________________
Don't wound what you can't kill
Ade is offline   Reply With Quote
Old Oct 10th, 2007, 11:06 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 9 DaWei is on a distinguished road
Perhaps you have spaces in the path? Are you escaping backslashes, if you're using backslashes? (You don't mention your system.)
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem processing file into a char array csrocker101 C++ 1 May 8th, 2007 11:50 PM
converting string to float beginnerCCC C 22 Oct 2nd, 2006 11:59 PM
OnlineTextEditor.Com! Sane Show Off Your Open Source Projects 43 Jun 16th, 2006 8:55 AM
After execution - Error cannot locate /Skin File? wchar Visual Basic 1 Mar 5th, 2005 9:04 PM
airport Log program using 3D linked List : problem reading from file gemini_shooter C++ 0 Mar 2nd, 2005 4:12 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:07 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC