The effective UID / GID is the UID / GID that the software is using right now (for example, software running as root can change its UID / GID to daemon: daemon, so the effective UID / GID will also be changed. / GID is the UID / GID of the process owner and never changes after the process starts.
Thus, the file_exists call is made with the permissions of the process owner
source share