Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 2.04 KB

filelength-filelengthi64.md

File metadata and controls

60 lines (44 loc) · 2.04 KB
description title ms.date api_name api_location api_type topic_type f1_keywords helpviewer_keywords ms.assetid
Learn more about: _filelength, _filelengthi64
_filelength, _filelengthi64
4/2/2020
_filelengthi64
_filelength
_o__filelength
_o__filelengthi64
msvcrt.dll
msvcr80.dll
msvcr90.dll
msvcr100.dll
msvcr100_clr0400.dll
msvcr110.dll
msvcr110_clr0400.dll
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
api-ms-win-crt-stdio-l1-1-0.dll
DLLExport
apiref
_filelength
_filelengthi64
filelengthi64
filelengthi64 function
lengths, file
filelength function
_filelength function
files [C++], length
_filelengthi64 function
3ab83d5a-543c-4079-b9d9-0abfc7da0275

_filelength, _filelengthi64

Gets the length of a file.

Syntax

long _filelength(
   int fd
);
__int64 _filelengthi64(
   int fd
);

Parameters

fd
Target the file descriptor.

Return value

Both _filelength and _filelengthi64 return the file length, in bytes, of the target file associated with fd. If fd is an invalid file descriptor, this function invokes the invalid parameter handler, as described in Parameter validation. If execution is allowed to continue, both functions return -1L to indicate an error and set errno to EBADF.

Remarks

By default, this function's global state is scoped to the application. To change this behavior, see Global state in the CRT.

Requirements

Function Required header
_filelength <io.h>
_filelengthi64 <io.h>

For more compatibility information, see Compatibility.

Example

See the example for _chsize.

See also

File handling
_chsize
_fileno
_fstat, _fstat32, _fstat64, _fstati64, _fstat32i64, _fstat64i32
_stat, _wstat functions