inside a Folder I have a file, named
`111-aaaaaa aa aaaa-,._aaaaaaa; aaaaaaaa, aa aaaaaaaaaa, aaaaaaaaa aaaaaaaa. 03.01.10. 38.38 aaaaa.txt`
when I browse that directory with PHP (or trying to read that file):
var_dump(glob('MyFolder/*'));exit;
It can't find that file. What's problem? (if I shorten the filename, then it becomes findable. I am on windows)
Starting with PHP 7.1 long and UTF-8 paths on Windows are supported directly in the core.
Cheers.
try
scandir()
it's show list file in array.Windows in particular has a very short file name limit in its original Win32 API. This general problem is discussed here at SO.
At most about 260 characters can be used in an absolute path on Win32. On other platforms there are other limits, but at least 512 characters is to be expected and more is not unheard of.
(For instance, in GNU HURD, there effectively is no limit to file lengths, even though the underlying file system may impose a limit.)
However, Windows actually can have longer filenames (obviously, as you have them on your computer). This works by using a newer Windows API. Unfortunately, standard PHP does not use this API, as far as I know.
There is a modified version of PHP which makes use of this newer Windows API over at Github.
Another benefit from using that newer API is that it also supports Unicode characters in the file names.