Bug #63553 [Nab]: file* functions fail for Thumbs.db (stat failed)
| From: | v1nkscaper at gmail dot com | Date: | Sun, 18 Nov 2012 16:59:01 +0000 |
| Subject: | Bug #63553 [Nab]: file* functions fail for Thumbs.db (stat failed) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-174786@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63553&edit=1
ID: 63553
User updated by: v1nkscaper at gmail dot com
Reported by: v1nkscaper at gmail dot com
Summary: file* functions fail for Thumbs.db (stat failed)
Status: Not a bug
Type: Bug
Package: *Directory/Filesystem functions
Operating System: ReadyNas DUO
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Sorry.
Was running filesize on "basename" instead of complete path.
(It gest unnoticed because I got the "icon.png" and Thumbs.db in (almost) every
folder)
But warning message is unclear. It should be "no such file" instead of "stat
failed"
Previous Comments:
------------------------------------------------------------------------
[2012-11-18 15:37:01] rasmus@php.net
Sorry, I don't see how this could possibly be a PHP problem. PHP just calls your
operating system's stat function.
------------------------------------------------------------------------
[2012-11-18 15:29:07] v1nkscaper at gmail dot com
Description:
------------
every function related to file information (atime,mtime,filesize,filetype...)
fails when applied on "Thumbs.db" file.
those functions work fine with a "icon.png" owned by same owner/group in the
same directory
renaming "Thumbs.db" to "foo.txt" doesn't help.
if you google "stat failed thumbs.db" you'll see these bug appear on some sites.
A Thumbs.db is a cache file that contains thumbnails of files that lies in a
directory.
Such a file is generated by Windows OS.
you can download one for exemple @ http://www.broux.fr/wp-
content/themes/kelta/wpv_theme/samples/
PHP 5.2.0-8+etch9~bpo31+1 (cgi-fcgi) (built: Feb 11 2008 15:40:46)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
running on 2.6.17.14ReadyNAS
(AFAIK this is the last version packaged fot this system)
Test script:
---------------
filesize("Thumbs.db"); // warning
filesize("icon.png"); // works fine
Expected result:
----------------
actual size of file
Actual result:
--------------
Warning: filesize() [function.filesize]: stat failed for Thumbs.db
when I run the stat command in the OS it works
nas-NETGEAR:/test# stat Thumbs.db
File: "Thumbs.db"
Size: 65024 Blocks: 128 IO Block: 16384 Regular File
Device: fe00h/xxxxx Inode: 79167686 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 98/ admin)
Access: 2012-11-17 00:59:15.000000000 -0800
Modify: 2012-11-17 00:59:16.000000000 -0800
Change: 2012-11-17 00:59:15.000000000 -0800
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63553&edit=1