Bug #57560 [Opn->Nab]: finfo_file cannot open (No such file or directory)
| From: | felipe@php.net | Date: | Sat, 28 Jul 2012 22:13:53 +0000 |
| Subject: | Bug #57560 [Opn->Nab]: finfo_file cannot open (No such file or directory) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-172306@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=57560&edit=1
ID: 57560
Updated by: felipe@php.net
Reported by: nomadcanuck at yahoo dot com
Summary: finfo_file cannot open (No such file or directory)
-Status: Open
+Status: Not a bug
Type: Bug
-Package: Fileinfo
+Package: *General Issues
Operating System: Windows XP
PHP Version: 5.2.1
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
Previous Comments:
------------------------------------------------------------------------
[2007-03-31 11:00:02] nashbridges12 at hotmail dot com
I can confirm that bug. The solution is to use the full path to the file eg. echo
finfo_file($finfo, realpath($filename))
------------------------------------------------------------------------
[2007-03-04 00:00:03] nomadcanuck at yahoo dot com
Description:
------------
Apache/2.2.4 (Win32) PHP/5.2.1
fileinfo support enabled
exif_read_data function returns "FILE.MimeType: image/jpeg" on same files.
Reproduce code:
---------------
<?php
$finfo = finfo_open(FILEINFO_MIME, 'C:/wamp/php/extras/magic');
foreach (glob("*") as $filename) {
echo $filename . "<br />";
echo finfo_file($finfo, $filename) . "<br />";
}
finfo_close($finfo);
?>
Expected result:
----------------
image/jpeg
image/jpeg
image/jpeg
image/jpeg
Actual result:
--------------
test1.JPG
cannot open `test1.JPG' (No such file or directory)
test2.JPG
cannot open `test2.JPG' (No such file or directory)
test3.jpg
cannot open `test3.jpg' (No such file or directory)
test4.jpg
cannot open `test4.jpg' (No such file or directory)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=57560&edit=1