Mono Class Library: Mono.Unix.UnixFileSystemInfo Overview | Members

Mono.Unix.UnixFileSystemInfo.SetLength Method

Truncate or extend UnixFileSystemInfo.FullName to be length bytes in size.

public void SetLength (long length)

See Also

Mono.Unix.Native.Syscall.truncate

Parameters

length
A long containing the desired file size for UnixFileSystemInfo.FullName

Exceptions

TypeReason
UnauthorizedAccessException

Search permission is denied for a component of the path UnixFileSystemInfo.FullName. [Mono.Unix.Native.Errno.EACCES]

-or-

UnixFileSystemInfo.FullName is not writable by the user. [Mono.Unix.Native.Errno.EACCES]

-or-

UnixFileSystemInfo.FullName is a directory. [Mono.Unix.Native.Errno.EISDIR]

System.IO.DirectoryNotFoundException A component of the path prefix of UnixFileSystemInfo.FullName is not a directory. [Mono.Unix.Native.Errno.ENOTDIR]
System.IO.FileNotFoundException A component of UnixFileSystemInfo.FullName that must exist does not exist. [Mono.Unix.Native.Errno.ENOENT]
System.IO.IOException

UnixFileSystemInfo.FullName resides on a read-only file system. [Mono.Unix.Native.Errno.EROFS]

-or-

An I/O error occurred while making the directory entry or allocating the inode. [Mono.Unix.Native.Errno.EIO]

System.IO.PathTooLongExceptionUnixFileSystemInfo.FullName was too long. [Mono.Unix.Native.Errno.ENAMETOOLONG]
Mono.Unix.UnixIOException

Too many symbolic links were encountered in translating UnixFileSystemInfo.FullName. [Mono.Unix.Native.Errno.ELOOP]

-or-

UnixFileSystemInfo.FullName is a pure procedure (shared text) file that is being executed and Mono.Unix.Native.Syscall.open requests write access. [Mono.Unix.Native.Errno.ETXTBSY]

Remarks

If UnixFileSystemInfo.Length is less than length, the file will be extended as if by writing bytes with the value zero.

If UnixFileSystemInfo.Length is greater than length, then the extra data is lost.

Requirements

Namespace: Mono.Unix
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0