I am interesting in somehow obtaining the mode of a file prior to performing actions on that file in PHP. I already know there are ways to chmod, chown or chgrp, based on the permissions of the scripts and such, but I am looking for a way to determine if a file's mode is, for example, 0644 or 0775.
Is there a way to do this in PHP? I have had no luck in finding this in any way.