Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
file_exists: filename with space never exists
Old 08-11-2009, 11:47 AM file_exists: filename with space never exists
Novice Talker

Posts: 9
Trades: 0
Hi
This is all in a loop in CLI php in XP.
Is there a way round this problem (note space in filename before '[' ):
$newfile = '"'.$path_info['filename'] . ' [Compatibility Mode].pdf"';
while (!file_exists($newfile)){
echo "Waiting for file to exist " . $newfile;
}
The file never exists (and it does, after it's created by PDFCreator).
But if I subsitute the value in $newfile, it works, ie
while (!file_exists("abc [Compatibility Mode].pdf")){
exits the loop once abc [Compatibility Mode].pdf is created.
geekpie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-11-2009, 02:32 PM Re: file_exists: filename with space never exists
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
You have $newfile in quotes

$newfile = '"'.$path_info['filename'] . ' [Compatibility Mode].pdf"';

So if $path_info['filename'] is 'abc' you'd get

$newfile = '"abc [Compability Mode].pdf"';

but it should be

$newfile = 'abc [Compability Mode].pdf';

So change your row into

$newfile = $path_info['filename'] . ' [Compatibility Mode].pdf';
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 08-12-2009, 12:31 PM Re: file_exists: filename with space never exists
Novice Talker

Posts: 9
Trades: 0
Thanks!
geekpie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to file_exists: filename with space never exists
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11484 seconds with 12 queries