Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
File Services
File Systems
File Management
 GetFileSizeEx Function

  Switch on low bandwidth view
GetFileSizeEx Function

Retrieves the size of the specified file.

Syntax

C++
BOOL WINAPI GetFileSizeEx(
  __in   HANDLE hFile,
  __out  PLARGE_INTEGER lpFileSize
);

Parameters

hFile [in]

A handle to the file. The handle must have been created with either the GENERIC_READ or GENERIC_WRITE access right. For more information, see File Security and Access Rights.

lpFileSize [out]

A pointer to a LARGE_INTEGER structure that receives the file size, in bytes.

Return Value

If the function succeeds, the return value is nonzero.

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

Remarks

Transacted Operations:  If there is a transaction bound to the file handle, then the function returns information for the isolated file view.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll

See Also

File Management Functions
LARGE_INTEGER

Send comments about this topic to Microsoft

Build date: 7/9/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
vb.net syntax      dmex   |   Edit   |   Show History
<DllImport("kernel32.dll", SetLastError:=True)> 
Public Shared Function GetFileSizeEx(ByVal hFile As IntPtr, ByRef lpFileSize As LARGE_INTEGER) As Boolean End Function
Flag as ContentBug
C# syntax      dmex   |   Edit   |   Show History
[DllImport("kernel32.dll", SetLastError=true)]
internal static extern bool GetFileSizeEx(IntPtr hFile, ref LARGE_INTEGER lpFileSize);
Tags What's this?: c# (x) Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker