Home

EACCES

EACCES is a POSIX errno value that indicates a permission denied condition. It is returned by the kernel or standard library when a process attempts an operation for which it does not have the required access rights, such as opening, reading, writing, or executing a file, or accessing a directory component without the necessary permissions.

Common scenarios include trying to open a read-only file for writing, attempting to execute a program or

Cross-platform behavior varies. In POSIX environments EACCES is well defined, typically with a numeric value of

Handling EACCES involves checking the errno after a failure, logging or displaying a user-friendly message, and

See also: EPERM, ENOENT, and other errno values related to access control and file system permissions.

script
without
the
execute
bit
set,
or
trying
to
traverse
a
directory
path
for
which
the
process
lacks
execute
(search)
permission
on
one
of
the
components.
EACCES
is
a
permission-related
error
distinct
from
errors
caused
by
a
missing
file
(ENOENT)
or
an
unsupported
operation
(EPERM
in
some
cases).
In
practice,
a
program
may
receive
EACCES
from
system
calls
like
open,
access,
stat,
or
chown
when
the
effective
user
ID
does
not
grant
the
requested
access.
13
on
Linux
and
many
other
systems.
On
Windows,
similar
permission
issues
may
be
reported
through
different
error
codes,
often
translated
by
language
runtimes
into
a
generic
access-denied
message
that
resembles
EACCES
in
meaning.
adjusting
permissions
or
ownership
as
appropriate.
Remedies
include
changing
file
or
directory
permissions
(chmod,
chown),
configuring
access
control
lists,
ensuring
the
correct
interpreter
or
mount
options
(such
as
noexec)
are
used,
or
performing
operations
with
elevated
privileges
if
justified.