Mono Class Library: System.Security.Permissions Namespace

System.Security.Permissions.FileIOPermission Class

Secures access to files and directories.

See Also: FileIOPermission Members

System.Object
     System.Security.CodeAccessPermission
          System.Security.Permissions.FileIOPermission

[System.Runtime.InteropServices.ComVisible(true)]
public sealed class FileIOPermission : System.Security.CodeAccessPermission, IBuiltInPermission, IUnrestrictedPermission

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Remarks

System.Security.Permissions.FileIOPermission objects describe protected operations on files and directories. Files and directories are specified using absolute paths. Case-sensitivity of files and directories is platform and file system dependent.

Note:

This permission distinguishes between the following types of file I/O access provided by System.Security.Permissions.FileIOPermissionAccess:

  • Read: Read access to the contents of the file or access to information about the file, such as its length or last modification time.
  • Write: Write access to the contents of the file or access to change information about the file, such as its name. Also allows for deletion and overwriting.
  • Append : Ability to write to the end of a file only.
  • PathDiscovery: Ability to obtain path information about a file.
  • NoAccess: No access to the file or directory.
  • AllAccess: Full access to the file or directory.

These access levels are independent, meaning that rights to one do not imply rights to another. For example, Write permission does not imply permission to Read or Append. System.Security.Permissions.FileIOPermissionAccess values can be combined using a bitwise OR operator.

For information on security considerations when accessing files, see System.IO.FileStream .

The XML encoding of a FileIOPermission instance is defined below in EBNF format. The following conventions are used:

The following meta-language symbols are used:

BuildVersion refers to the build version of the shipping CLI. This is specified as a dotted build number such as '2412.0' .

ECMAPubKeyToken ::= b77a5c561934e089

FileName refers to the full path and file name of a file, or to a path name, such as "C:\Temp\test.exe" or "C:\ ".

The XML encoding of a FileIOPermission instance is as follows:

FileIOPermissionXML ::=

<IPermissionclass="

System.Security.Permissions.FileIOPermission,

mscorlib,

Version=1.0.BuildVersion,

Culture=neutral,

PublicKeyToken=ECMAPubKeyToken"

version="1"

(

Unrestricted="true"

)

|

(

(Read="FileName (; FileName )*" ) ?

(Write="FileName (; FileName )*" ) ?

(Append="FileName (; FileName )*" ) ?

(PathDiscovery="FileName (; FileName )*" ) ?

)

/>

Requirements

Namespace: System.Security.Permissions
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0