[PHP] Re: file_exists fun

2011-12-02 Thread Dee Ayy
On Fri, Dec 2, 2011 at 1:30 PM, Dee Ayy dee@gmail.com wrote: The following code:                        $new_file = ADS_DIR_INTERNAL.'/'.$ad_info['id'].'_'.$ad_info['filename'];                        echo NEW_FILE:[.$new_file.]\n;                        echo file_exists Using

[PHP] Re: file_exists and wildcard/regex

2008-12-09 Thread Maciek Sokolewicz
Daniel Kolbo wrote: What is the preferred method with php to test and see if a file [pattern] exists? For example, i only need to search in one directory, that may have any number of files named such as afile1.txt, afile2.txt, afile3.txt, And also, bfile1.txt, bfile2.txt, bfile3.txt,

[PHP] Re: file_exists and wildcard/regex

2008-12-09 Thread Daniel Kolbo
Maciek Sokolewicz wrote: Daniel Kolbo wrote: What is the preferred method with php to test and see if a file [pattern] exists? For example, i only need to search in one directory, that may have any number of files named such as afile1.txt, afile2.txt, afile3.txt, And also, bfile1.txt,

Re: [PHP] Re: file_exists and wildcard/regex

2008-12-09 Thread Chris
Daniel Kolbo wrote: Maciek Sokolewicz wrote: Daniel Kolbo wrote: What is the preferred method with php to test and see if a file [pattern] exists? For example, i only need to search in one directory, that may have any number of files named such as afile1.txt, afile2.txt, afile3.txt,

Re: [PHP] Re: file_exists and wildcard/regex

2008-12-09 Thread Stut
On 9 Dec 2008, at 23:24, Daniel Kolbo wrote: Maciek Sokolewicz wrote: Daniel Kolbo wrote: What is the preferred method with php to test and see if a file [pattern] exists? For example, i only need to search in one directory, that may have any number of files named such as afile1.txt,

Re: [PHP] Re: file_exists and wildcard/regex

2008-12-09 Thread German Geek
On Wed, Dec 10, 2008 at 1:13 PM, Stut [EMAIL PROTECTED] wrote: On 9 Dec 2008, at 23:24, Daniel Kolbo wrote: Maciek Sokolewicz wrote: Daniel Kolbo wrote: What is the preferred method with php to test and see if a file [pattern] exists? For example, i only need to search in one

[PHP] Re: file_Exists() and case

2008-11-28 Thread Lupus Michaelis
Stan a écrit : The script is running on an UBUNTU v8.04 LAMP server. Case is supposed to matter, isn't it? With a POSIX filesystem only. If you store you're pictures in a fat or ntfs filesystem, case sensitive will not matter. BTW, extension concept doesn't exists in POSIX filesystems,

[PHP] Re: file_Exists() and case

2008-11-24 Thread Stan
Stut, Shouting is something that happens when people are actually speaking and listening. In a medium where there is no other way to emphasize salient points in a message, capitalization is all that works. I'm sorry it offended your sensabilities. realpath() fails, just like file_exists()

Re: [PHP] Re: file_Exists() and case

2008-11-24 Thread Stut
On 24 Nov 2008, at 14:41, Stan wrote: Shouting is something that happens when people are actually speaking and listening. In a medium where there is no other way to emphasize salient points in a message, capitalization is all that works. I'm sorry it offended your sensabilities. It's

Re: [PHP] Re: file_Exists() and case

2008-11-24 Thread Bastien Koert
On Mon, Nov 24, 2008 at 10:02 AM, Stut [EMAIL PROTECTED] wrote: On 24 Nov 2008, at 14:41, Stan wrote: Shouting is something that happens when people are actually speaking and listening. In a medium where there is no other way to emphasize salient points in a message, capitalization is all

[PHP] Re: file_Exists() and case

2008-11-23 Thread Stan
Let me attack this in a different way. This started because my camera names files whatever.JPG and my thumbnail generator generates thumbnail files whatever.jpg. Given my workstation (upon which I edit code and run a web browser) is W2K and my web server is APACHE2 on UBUNTU, I sometimes have to

Re: [PHP] Re: file_Exists() and case

2008-11-23 Thread Stut
On 23 Nov 2008, at 18:53, Stan wrote: Let me attack this in a different way. This started because my camera names files whatever.JPG and my thumbnail generator generates thumbnail files whatever.jpg. Given my workstation (upon which I edit code and run a web browser) is W2K and my web

[PHP] Re: file_Exists() and case

2008-11-23 Thread Nathan Rixham
Stan wrote: How can I do that, please? Do what? Detect, programmatically, FOR SURE and FOR CERTAIN, that a specific file exists. http://uk2.php.net/touch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: file_Exists() and case

2008-11-23 Thread Stan
This thread began because file_exists() WILL NOT tell that a file exists FOR SURE and FOR CERTAIN if the file you check for happens to be named whatever.jpg and whatever.JPG exists. I know this because IMagick then chokes on whatever.jpg because it DOESN't exist. -- PHP General Mailing List

[PHP] Re: file_Exists() and case

2008-11-23 Thread Stan
I do NOT want to create an empty file! Nathan Rixham [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Stan wrote: How can I do that, please? Do what? Detect, programmatically, FOR SURE and FOR CERTAIN, that a specific file exists. http://uk2.php.net/touch -- PHP General

Re: [PHP] Re: file_Exists() and case

2008-11-23 Thread Ashley Sheridan
On Sun, 2008-11-23 at 13:12 -0600, Stan wrote: This thread began because file_exists() WILL NOT tell that a file exists FOR SURE and FOR CERTAIN if the file you check for happens to be named whatever.jpg and whatever.JPG exists. I know this because IMagick then chokes on whatever.jpg because

Re: [PHP] Re: file_Exists() and case

2008-11-23 Thread Nathan Rixham
Stan wrote: This thread began because file_exists() WILL NOT tell that a file exists FOR SURE and FOR CERTAIN if the file you check for happens to be named whatever.jpg and whatever.JPG exists. I know this because IMagick then chokes on whatever.jpg because it DOESN't exist. a: you really

Re: [PHP] Re: file_Exists() and case

2008-11-23 Thread Stut
On 23 Nov 2008, at 19:12, Stan wrote: This thread began because file_exists() WILL NOT tell that a file exists FOR SURE and FOR CERTAIN if the file you check for happens to be named whatever.jpg and whatever.JPG exists. I know this because IMagick then chokes on whatever.jpg because it

[PHP] Re: file_exists

2007-11-15 Thread Colin Guthrie
Instruct ICC wrote: Date: Thu, 15 Nov 2007 00:20:52 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] file_exists Philip Thompson wrote: I've run into similar problems where I *thought* I was looking in the correct location... but I

Re: [PHP] Re: file_exists

2007-11-15 Thread Casey
I think file_exists returns false for remote files ;) On Nov 15, 2007, at 2:33 AM, Colin Guthrie [EMAIL PROTECTED] wrote: Instruct ICC wrote: Date: Thu, 15 Nov 2007 00:20:52 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] file_exists

[PHP] Re: file_exists

2007-11-15 Thread Colin Guthrie
Casey wrote: I think file_exists returns false for remote files ;) Even if it did (it doesn't: http://uk3.php.net/manual/en/wrappers.ftp.php), I'd still rather not let someone steal my /etc/passwd or /etc/shadow etc. files. As I said before. Some form of regexp or similar restriction is

RE: [PHP] Re: file_exists

2007-11-15 Thread Instruct ICC
I think file_exists returns false for remote files ;) Even if it did (it doesn't: http://uk3.php.net/manual/en/wrappers.ftp.php), I'd still rather not let someone steal my /etc/passwd or /etc/shadow etc. files. As I said before. Some form of regexp or similar restriction is 100%

Re: [PHP] Re: file_exists

2007-11-15 Thread William Betts
It could present a problem depending on how the permissions are setup on the shared hosting and if open_base is in effect. If they can get the /etc/shadow file from a php being ran by apache then you have an issue, because apache would be running as root. Take the below example.

[PHP] Re: file_exists()

2005-10-22 Thread Oliver Grätz
Jonny Bergström schrieb: Hi file_exists('字.gif') always returns false. Can anyone help me find out a way to make it work also for these kind of filenames? Unicode filenames can't be properly handled up to now for all I know. Perhaps waiting for PHP6 might be your only solution. OLLi --

Re: [PHP] Re: file_exists()

2005-10-22 Thread Robert Cummings
On Sat, 2005-10-22 at 19:19, Oliver Grätz wrote: Jonny Bergström schrieb: Hi file_exists('字.gif') always returns false. Can anyone help me find out a way to make it work also for these kind of filenames? Unicode filenames can't be properly handled up to now for all I know.

Re: [PHP] Re: file_exists()

2005-10-22 Thread Oliver Grätz
Robert Cummings schrieb: You could try execing a shell command to give you the answer. I don't know if it'll work, but worth a shot if you're in a bind. Yep, good idea. Use the native code of the OS ofr listing the file (dir, ls...) and parse the result. OLLi Manche sagen,

Re: [PHP] Re: file_exists()

2005-10-22 Thread Jonny Bergström
Good idea yes. But apparantly Windows couldn't do it either. :-( function file_exists_windows($path) { exec('dir ' . $path, $output, $return_status); return $return_status == 0 ? true : false; // Windows dir will return 0 when something was found } It works with normal ascii file names, but

Re: [PHP] Re: file_exists()

2005-10-22 Thread Richard Lynch
On Sat, October 22, 2005 7:12 pm, Jonny Bergström wrote: Good idea yes. But apparantly Windows couldn't do it either. :-( function file_exists_windows($path) { exec('dir ' . $path, $output, $return_status); return $return_status == 0 ? true : false; // Windows dir will return 0 when

Re: [PHP] Re: file_exists()

2005-10-22 Thread Jonny Bergström
On 10/23/05, Oliver Grätz [EMAIL PROTECTED] wrote: I believe that the problem is not Windows being unable to look fpr unicode files but PHP being unable to put th unicode string correctly in the command line you are trying to execute. Check this by doing exec('echo test.txt'.$path); and

[PHP] Re: file_exists() to search for *.xml file with a wild card???

2004-07-20 Thread Jason Barnett
Scott Fletcher wrote: I would like to use the file_exists() or something similar to check for the existance of any of the xml files regardless of what filename it use. Like file_exist(*.xml) for example. Anyone know?? FletchSOD fnmatch() -- PHP General Mailing List (http://www.php.net/) To

[PHP] Re: file_exists on Windows problem

2003-11-20 Thread David Strencsev
If you're using NTFS file system... please make sure that the PHP's temporay UPLOAD directory and SESSIONDATA directory are set with the correct permissions. I mean that the user IUSR_YOURCOMPUTER has write permissions in these directories. Hope it will help - David Strencsev -- PHP General

[PHP] Re: file_exists on Windows problem

2003-11-20 Thread Chris Williams
Thanks, that worked David Strencsev [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If you're using NTFS file system... please make sure that the PHP's temporay UPLOAD directory and SESSIONDATA directory are set with the correct permissions. I mean that the user IUSR_YOURCOMPUTER

[PHP] Re: file_exists on Windows problem

2003-11-19 Thread Manuel Vázquez Acosta
It may be an OS feature file_exists relies on... But you can use is_uploaded_file() function to check whether the file exists or not. Manu. Chris Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm again trying to understand differences in Apache and Windows installs of PHP

[PHP] Re: file_exists on Windows problem

2003-11-19 Thread Chris Williams
Thanks, but it make the test to move on to other things like, size($filename) which tells me the file does not exist. Chris Manuel VáZquez Acosta [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It may be an OS feature file_exists relies on... But you can use is_uploaded_file()

Re: [PHP] Re: file_exists on Windows problem

2003-11-19 Thread Jason Wong
On Thursday 20 November 2003 13:05, Chris Williams wrote: Thanks, but it make the test to move on to other things like, size($filename) which tells me the file does not exist. print_r($_FILES) -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators *

[PHP] Re: file_exists for URLs

2002-10-14 Thread Owen Prime
Have a look at the fopen() function in the FileSystem Function section of the Docs. fopen() can open a file over http:// and I imagine it returns FALSE if it cant open it. If it doesn't return false, you could analyse the headers in $http_response_header. Hope this helps. Cheers, Owen Prime

[PHP] Re: file_exists

2002-05-06 Thread Austin Marshall
Craig Westerman wrote: What am I doing wrong? I get parse error between first echo statement and else. Thanks Craig [EMAIL PROTECTED] ?php $fn = image.gif; if (!file_exists($fn)) { echo img src=noimageexists.gif; else echo img src=$fn; } ? You've got your semicolons in

[PHP] Re: file_exists problems

2001-12-01 Thread Fred
file_exists takes a string argument. /images/$filename is not a string. try images/ . $filename instead. Fred Prolog [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I had a script that was running beautiful that simply called up a database and displayed the