UPDATED
As the title says, is there a way to toggle the “Hidden” or “Read-Only” switch on Windows using PHP?
I’d like to do this without opening a shell exec() if possible.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A file can’t be hidden, it’s always in the file system. There’s the *NIX convention that files starting with a
.are not shown by default for certain operations (like thelscommand), but only if you don’t look hard enough. The same goes for Windows, but Windows handles it with file meta attributes.What you can/should do is use file permissions to make the folder/file inaccessible to anybody who has no business accessing it. Use
chmod,chownandchgrpto do so from PHP. You may have to learn a bit about proper file system permissions though.