2

I created a folder through Windows Explorer, but is_dir returns FALSE.

A path that fails:

ficheiros/dinamicos/multimedia/imagem/areas/galerias/actividades/professores/iii-xxxxxxxx-xxxxxxxx-xx-xxxxxxxxxxx-xxx-xxxxxxxx-abcdefg/__fmhidden__681d75e470b4fd52f7d3b468b8ce7b5b/__fmhidden__b14a7b8059d9c055954c92674ce60032

This one doesn't fail:

ficheiros/dinamicos/multimedia/imagem/areas/galerias/actividades/professores/iii-xxxxxxxx-xxxxxxxx-xx-xxxxxxxxxxx-xxx-xxxxxxxx-a/__fmhidden__681d75e470b4fd52f7d3b468b8ce7b5b/__fmhidden__b14a7b8059d9c055954c92674ce60032

My code used to work flawlessly for months. After debugging it, I found that the problem was with mkdir/is_dir. The strange part is that it only happens when the path length was bigger than 218 characters (247 as absolute).

Is there any limit to the path length for is_dir and mkdir (in Windows environments)?

Pacerier
  • 81,402
  • 98
  • 349
  • 618
M. Cesar
  • 3,672
  • 4
  • 21
  • 34

1 Answers1

1

In Windows the character limit of file paths is 260 (with some exceptions) so the PHP mk_dir and is_dir functions may not work as you expect.

See: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath

  • thank you. That should be the issue. It isn't that problematic since it will only be deployed in unix systems – M. Cesar Sep 13 '13 at 20:39