|
of_includefile
|
|
Full name
|
pfc_n_cst_filesrv.of_includefile
|
Access
|
protected
|
Extend of
|
boolean
|
Return value
|
boolean
|
Prototype
|
protected function boolean of_includefile(string,long,unsignedlong)
|
Name
|
Datatype
|
lb_ReadWrite
|
boolean
|
lnv_Numeric
|
n_cst_numerical
|
protected function boolean of_includefile (string as_filename, long al_attribmask, unsignedlong aul_fileattrib);//////////////////////////////////////////////////////////////////////////////
// Protected Function: of_IncludeFile
// Arguments: as_FileName The name of the file.
// al_AttribMask The bit string that determines which files to include.
// aul_FileAttrib The attribute bits for the file.
// Returns: Boolean - True if the file should be included, False if not.
// Description: Determine whether a file should be included by the of_DirList function.
// This is based on the attributes of the desired files and the file's attributes.
//////////////////////////////////////////////////////////////////////////////
// Rev. History: Version
// 5.0 Initial version
// 5.0.02 Fixed problem with NTFS file systems using different value for FILE_ATTRIBUTE_NORMAL
//////////////////////////////////////////////////////////////////////////////
// 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.
//////////////////////////////////////////////////////////////////////////////
boolean lb_ReadWrite
n_cst_numerical lnv_Numeric
// Never include the "[.]" directory entry
If as_FileName = "." Then Return False
// If the mask is > 32768, then read/write files should be excluded
If al_AttribMask >=32768 Then
al_AttribMask = al_AttribMask - 32768
lb_ReadWrite = False
Else
lb_ReadWrite = True
End if
// If the type is > 16384, then a list of drives should be included
If al_AttribMask >= 16384 Then al_AttribMask = al_AttribMask - 16384
// Include the file if lb_ReadWrite is true and the file is a read-write or
// read-only file (with or without the archive bit set)
// NTFS File Systems set Read/Write Files (FILE_ATTRIBUTE_NORMAL) = 128
If (lb_ReadWrite And (aul_FileAttrib = 0 Or &
aul_FileAttrib = 1 Or &
aul_FileAttrib = 32 Or &
aul_FileAttrib = 33 Or &
aul_FileAttrib = 128)) Then Return True
// Or include it if its attributes match the mask passed in (use bitwise AND).
If lnv_Numeric.of_BitwiseAnd(aul_FileAttrib, al_AttribMask) > 0 Then Return True
Return False
end function