A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/windows/win32/api/FileAPI/nf-fileapi-setendoffile below:

SetEndOfFile function (fileapi.h) - Win32 apps

Sets the physical file size for the specified file to the current position of the file pointer.

The physical file size is also referred to as the end of the file. The SetEndOfFile function can be used to truncate or extend a file. To set the logical end of a file, use the SetFileValidData function.

Syntax
BOOL SetEndOfFile(
  [in] HANDLE hFile
);
Parameters

[in] hFile

A handle to the file to be extended or truncated.

The file handle must be created with the GENERIC_WRITE access right. For more information, see File Security and Access Rights.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero (0). To get extended error information, call GetLastError.

The SetEndOfFile function can be used to truncate or extend a file. If the file is extended, the contents of the file between the old end of the file and the new end of the file are not defined.

Each file stream has the following:

The

SetEndOfFile

function sets the file size. Use

SetFileValidData

to set the valid data length.

If
CreateFileMapping is called to create a file mapping object for hFile, UnmapViewOfFile must be called first to unmap all views and call CloseHandle to close the file mapping object before you can call SetEndOfFile.

Transacted Operations

If there is a transaction bound to the handle, then the change in the end-of-file position is transacted.

In Windows 8 and Windows Server 2012, this function is supported by the following technologies.

Technology Supported Server Message Block (SMB) 3.0 protocol Yes SMB 3.0 Transparent Failover (TFO) Yes SMB 3.0 with Scale-out File Shares (SO) Yes Cluster Shared Volume File System (CsvFS) Yes Resilient File System (ReFS) Yes Requirements Requirement Value Minimum supported client Windows XP [desktop apps | UWP apps] Minimum supported server Windows Server 2003 [desktop apps | UWP apps] Target Platform Windows Header fileapi.h (include Windows.h) Library Kernel32.lib DLL Kernel32.dll See also

CloseHandle

CreateFile

CreateFileMapping

File Management Functions

SetFileInformationByHandle

SetFileValidData

UnmapViewOfFile


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4