FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » test for file existance
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: test for file existance [message #182863 is a reply to message #182857] Sat, 21 September 2013 21:28 Go to previous message
Richard Yates is currently offline  Richard Yates
Messages: 86
Registered: September 2013
Karma:
Member
On Sat, 21 Sep 2013 14:43:30 -0400, Lew Pitcher
<lew(dot)pitcher(at)digitalfreehold(dot)ca> wrote:

> On Saturday 21 September 2013 13:15, in comp.lang.php, tnp(at)invalid(dot)invalid
> wrote:
>
>> On 21/09/13 16:55, richard wrote:
>>> On Sat, 21 Sep 2013 10:16:02 -0400, richard wrote:
>>>
>>>> What would be a good way to test to see if the file actually esists?
>>>>
>>>> In my database I may have a file name listed, but don't have the actual
>>>> file.
>>>> So if you don't have the file, then why reference it?
>>>> For simplicity. When I enter one part of the pair, the other part simply
>>>> gets a "b" added to the name.
>>>> e.g 100 and 100b.
>>>>
>>>> Because there is no file to work with, I want to be able to post a
>>>> notice saying "not available" or what ever.
>>>
>>> Using their own example:
>>> <?php
>>> $filename = '/path/to/foo.txt';
>>>
>>> if (file_exists($filename)) {
>>> echo "The file $filename exists";
>>> } else {
>>> echo "The file $filename does not exist";
>>> }
>>> ?>
>>>
>>> Having tested this, it appears the response is wrong.
>>> I am told the file does not exist even if it does.
>>> is there something else I could use?
>>>
>> angle grinders are sutaible for use where files dont exist.
>
> Can you use an angle grinder to create a file?

That would be Object Oriented style, I believe.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ann: PDF report writer
Next Topic: Setting & displaying Variables
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 20:10:33 GMT 2024

Total time taken to generate the page: 0.04909 seconds