|
of_getfileattributes
|
|
Full name
|
pfc_n_cst_filesrvsol2.of_getfileattributes
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_getfileattributes(string,ref boolean,ref boolean,ref boolean,ref boolean,ref boolean)
|
Name
|
Datatype
|
lnv_Numeric
|
n_cst_numerical
|
lstr_FindData
|
os_finddata
|
lul_handle
|
ulong
|
public function integer of_getfileattributes (string as_filename, ref boolean ab_readonly, ref boolean ab_hidden, ref boolean ab_system, ref boolean ab_subdirectory, ref boolean ab_archive);//////////////////////////////////////////////////////////////////////////////
// Public Function: of_GetFileAttributes
// Arguments: as_FileName The file for which you want the attributes; an
// absolute path may be specified or it will
// be relative to the current working directory.
// ab_ReadOnly The Read-Only attribute, passed by reference.
// ab_Hidden The Hidden attribute, passed by reference.
// ab_System The System attribute, passed by reference.
// ab_Subdirectory The Subdirectory attribute, passed by reference.
// ab_Archive The Archive attribute, passed by reference.
// Returns: Integer
// 1 if successful, -1 if an error occurrs.
// Description: Get the attributes for 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.
//////////////////////////////////////////////////////////////////////////////
ulong lul_handle
os_finddata lstr_FindData
n_cst_numerical lnv_Numeric
// Find the file
lul_handle = FindFirstFileA(as_FileName, lstr_FindData)
If lul_handle <= 0 Then Return -1
FindClose(lul_handle)
// Set file attributes
ab_ReadOnly = lnv_Numeric.of_GetBit(lstr_FindData.ul_FileAttributes, 1)
ab_Hidden = lnv_Numeric.of_GetBit(lstr_FindData.ul_FileAttributes, 2)
ab_System = lnv_Numeric.of_GetBit(lstr_FindData.ul_FileAttributes, 3)
ab_SubDirectory = lnv_Numeric.of_GetBit(lstr_FindData.ul_FileAttributes, 5)
ab_Archive = lnv_Numeric.of_GetBit(lstr_FindData.ul_FileAttributes, 6)
Return 1
end function