Share via


RandomAccess.SetLength(SafeFileHandle, Int64) Metoda

Definice

Nastaví délku souboru na danou hodnotu.

public:
 static void SetLength(Microsoft::Win32::SafeHandles::SafeFileHandle ^ handle, long length);
public static void SetLength (Microsoft.Win32.SafeHandles.SafeFileHandle handle, long length);
static member SetLength : Microsoft.Win32.SafeHandles.SafeFileHandle * int64 -> unit
Public Shared Sub SetLength (handle As SafeFileHandle, length As Long)

Parametry

handle
SafeFileHandle

Popisovač souboru.

length
Int64

Délka souboru v bajtech.

Výjimky

handle je null.

Formát handle je neplatný.

Soubor je zavřený.

Soubor nepodporuje vyhledávání (kanál nebo soket).

length je negativní.

Platí pro