Home

Readonly

Readonly is a designation used across software and systems to indicate that a value or resource should not be altered during normal operation. Depending on context, immutability may be enforced by a language’s type system, a runtime check, or by access permissions at the operating system or application level. Different domains use similar concepts under different terminology.

In programming languages, readonly or equivalent constructs protect data from modification after initialization. In C#, the

In user interfaces and web forms, an element marked readonly cannot be edited by the user, while

In file systems, a read-only attribute or mount option prevents writing to a file or directory. Attempting

Read-only modes occur in databases and APIs to guarantee data stability during certain operations, such as

readonly
keyword
applies
to
fields
and
allows
assignment
only
in
a
constructor,
after
which
the
field
is
immutable
for
the
object's
lifetime;
it
contrasts
with
const,
which
is
a
compile-time
constant.
TypeScript
supports
readonly
on
properties
and
on
array
types
to
restrict
reassignment
and
mutation
through
the
type
system,
though
runtime
enforcement
is
not
guaranteed.
Some
languages
implement
immutability
via
final,
sealed,
or
immutable
data
structures,
which
can
differ
in
scope
and
semantics.
still
submitting
its
value
with
the
form.
This
differs
from
disabled
controls,
which
are
not
submitted.
The
readonly
attribute
is
commonly
used
for
fields
that
should
be
shown
and
submitted
but
not
edited.
to
modify
such
resources
typically
results
in
a
permission
error,
unless
the
attribute
is
removed
or
the
access
mode
is
changed.
long-running
queries
or
audits.
Overall,
readonly
is
a
broad
concept
used
to
protect
data
integrity
by
preventing
modifications
in
appropriate
contexts.