|
of_GetFileSize
|
|
Full name
|
pfc_n_cst_filesrvsol2.of_GetFileSize
|
Access
|
public
|
Extend of
|
double
|
Return value
|
double
|
Prototype
|
public function double of_GetFileSize(string)
|
Name
|
Datatype
|
ldb_Size
|
double
|
lstr_FindData
|
os_finddata
|
lul_handle
|
ulong
|
public function double of_GetFileSize (string as_FileName);//////////////////////////////////////////////////////////////////////////////
// Public Function: of_GetFileSize
// Arguments: as_FileName The name of the file whose size is desired; an
// absolute path may be specified or it will
// be relative to the current working directory
// Returns: Double The size of the file if successful, -1 if an error occurrs.
// Description: Get the size (in bytes) of a file.
//////////////////////////////////////////////////////////////////////////////
// Rev. History: Version
// 5.0.02 Initial version
//////////////////////////////////////////////////////////////////////////////
// Copyright © 1996-1999 Sybase, Inc. and its subsidiaries. All rights reserved. Any distribution of the
// PowerBuilder Foundation Classes (PFC) source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//////////////////////////////////////////////////////////////////////////////
double ldb_Size
ulong lul_handle
os_finddata lstr_FindData
// Get the file
lul_handle = FindFirstFileA(as_FileName, lstr_FindData)
If lul_handle <= 0 Then Return -1
FindClose(lul_handle)
// Calculate file size
ldb_Size = (lstr_FindData.ul_FileSizeHigh * (2.0 ^ 32)) + lstr_FindData.ul_FileSizeLow
Return ldb_Size
end function