Promotic
WikipediaLinkedInYoutubeTwitterFacebook

FileGetAttr - method of object Pm

Description:
Getting the file attributes.
Syntax:
FileGetAttr(sFile As String, nMask As Long) As Long
Calling:
val = Pm.FileGetAttr(sFile, nMask)
Parameters:
sFile(String) The file whose attributes have to be obtained. If a full path is not entered, it is completed relatively according to the application file folder.

It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files and folders.

nMask(Long) Determines which attributes have to be returned. For example, 1+2 returns the attributes "archive" and "read only".
1 - The attribute "archive" is returned.
2 - The attribute "read only" is returned.
4 - The attribute "hidden" is returned.
Return Values:
Returns the settings of required attributes according to the mask set in the nMask parameter. If the file does not exist or is not accessible, then -1 is returned.
Note:
The FileGetLength method can be used to get the file size.
 
This method is not functional for Web Panels.
Example:
It gets the attributes "archive" and "read only", see the parameter nMask = 1+2. The returned value is the numeric value depending on setting the bits. If the file has set only the attribute "archive", then in nAttr there is the value 1. If the file has set only the attribute "read only", then in nAttr there is the value 2. If the file has set both attributes, then in nAttr there is the value 3.
Dim sAttr, sFile, nAttr
sFile = "#app:file.txt"
nAttr = Pm.FileGetAttr(sFile, 1+2)
If nAttr >= 0 Then
  'When the attributes were get OK.
End If
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- FileGetAttr
 
 
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice