Edit report at https://bugs.php.net/bug.php?id=63248&edit=1

 ID:                 63248
 Patch added by:     a...@php.net
 Reported by:        a...@php.net
 Summary:            ext\fileinfo\tests\bug61964.phpt fails
 Status:             Open
 Type:               Bug
 Package:            *General Issues
 Operating System:   Windows
 PHP Version:        5.4Git-2012-10-09 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

The following patch has been added/updated:

Patch Name: bug63248.patch
Revision:   1350162505
URL:        
https://bugs.php.net/patch-display.php?bug=63248&patch=bug63248.patch&revision=1350162505


Previous Comments:
------------------------------------------------------------------------
[2012-10-13 15:36:48] re...@php.net

on windows we couldn't  fopen() or file_get_contents() a directory.
it didn't consist on *nix systems behavior

so does the test failed because of this. 

maybe we could update streams implementation?

------------------------------------------------------------------------
[2012-10-11 22:40:08] mattfic...@php.net

Most recent patch fixes the actual problem for me. Test still fails, but I 
don't get any error messages. It fails because the expected warning messages 
are missing.

------------------------------------------------------------------------
[2012-10-11 15:53:18] a...@php.net

Updated the patch, using the PHPs readdir implementation win32/readdir.c 
instead of reimlementing it :)

------------------------------------------------------------------------
[2012-10-11 15:42:01] a...@php.net

The following patch has been added/updated:

Patch Name: bug63248.patch
Revision:   1349970121
URL:        
https://bugs.php.net/patch-display.php?bug=63248&patch=bug63248.patch&revision=1349970121

------------------------------------------------------------------------
[2012-10-10 18:02:46] a...@php.net

The issue is the following - when a directory is given as a magic path, 
libmagic looks for files inside it and tries to load all the files as magic 
files. Under windows there are two wrong points

- libmagic tries to get a directory handle
- libmagic uses opendir, readdir and so on which doesn't well on windows

The patch prevents libmagic from opening a directory and uses FindNextFile from 
the windows API to iterate dirs.

After applying this patch there are two tests failing

ext\fileinfo\tests\finfo_file_regex-win32.phpt
ext\fileinfo\tests\finfo_open_error-win32.phpt

But, the corresponding non win32 tests pass. Different behaviour of that two 
win32 tests seems co be caused because of the bug in this ticket, so then they 
could be kicked after the patch was applied.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=63248


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63248&edit=1

Reply via email to