3
I’m listing Windows directories with scandir()
of PHP
, this way shows all items of the location, and would like to know if it is possible to check whether the folder or file displayed by PHP
is hidden in Windows.
3
I’m listing Windows directories with scandir()
of PHP
, this way shows all items of the location, and would like to know if it is possible to check whether the folder or file displayed by PHP
is hidden in Windows.
Browser other questions tagged php windows
You are not signed in. Login or sign up in order to post.
If you want this information, why did you choose
scandir
?– Bacco
because I use her array to return with json to another page
– João Victor
There is a way to do without the
scandir
, see in this discussion https://stackoverflow.com/a/28681410/10304819– André Lins
@Andrélins this was one of the most disgusting things I’ve ever seen in my life :D , using operating system commands to get the information. Not portable, not safe and still disabled in any minimally decent accommodation.
– Bacco
@Andrélins still want the array to have hidden folders and files, but to add along to them a variable pointing if it is hidden or not, for this I just need to know one way if it is or not, the rest I take a way kkk
– João Victor
I’ve never used it, but I’ve seen it in some places, so I brought the kkk option. How bad it would be to mention it there and the in the php comment. D
– André Lins
@Andrélins ah yes, bring the link is always good, but that is ugly, is :D - But as it comes to PHP, often only has ugly way to do certain things - I hope that comes some answer here that is "less ugly", if there is one. I can’t remember anything specific about PHP to read attributes of this type.
– Bacco
In the list of disgusting solutions there is this:
exec("dir \"{$path}\" /A:-H /B", $result);
(alternating the-H
forH
to take the unseen and the occult separately).– Bacco