# [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/Zend/tests/bug52041.phpt branches/PHP_5_4/Zend/zend_API.c branches/PHP_5_4/ext/standard/tests/file/005_variation2-win32.phpt branches/PHP_5_4/ext/standard/tests/file/copy_variation3-win3

- Thread: https://externals.io/message/55280
- Original archive: https://news-web.php.net/php.internals/55280
- Started by Pierre Joye on 2011-09-07T14:30:19+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #55280 — Pierre Joye — 2011-09-07T14:30:19+00:00

URL: https://externals.io/message/55280#55280

hi,

the main problem is that the (stupid) windows filesystem APIs consider
" foo", "foo " as being the same than "foo". It has caused all kind of
bad effects and we added checks in some areas already in 5.3.

Now that 5.4 has a "p" parameter we can simply cleanup the given paths
before passing it to the API.

I realized that unix does not raise a warning and simply check for the
actual path " foo" (in its full form), so this commit breaks the tests
on unix right now :P.

I will revert the tests change later today and go with another
solution, to escape the trailing spaces instead of rejecting them.
That should then behave the same way than on unix.

About:

CreateDirectoryW(L"\\\\?\\C:\\users\\gustavo.lopes\\ ",NULL);

It is a totally different thing as \\?\ paths are not treated the same
way by the underlying API (see msdn for the various path forms and how
they work, don't have the link at hand).

Cheers,


> Em Wed, 07 Sep 2011 13:41:45 +0100, Hannes Magnusson
> <hannes.magnusson@gmail.com> escreveu:
>
> > […]
>
> You don't need other filesystems. I tried (where C: is a NTFS volume):
>
> CreateDirectoryW(L"\\\\?\\C:\\users\\gustavo.lopes\\ ",NULL);
>
> and it created a directory with " " as its name.
>
>
> --
> Gustavo Lopes
>
> --
> 
> 
>
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
