GetAttr Function

λ³Όλ₯¨ λ˜λŠ” λ””λ ‰ν† λ¦¬μ˜ μ΄λ¦„μ΄λ‚˜ 파일 ν˜•μ‹μ„ μ‹λ³„ν•˜λŠ” λΉ„νŠΈ νŒ¨ν„΄μ„ κ΅¬ν•©λ‹ˆλ‹€.

ꡬ문:


GetAttr (Text As String)

λ°˜ν™˜ κ°’:

Integer

맀개 λ³€μˆ˜:

Text: λͺ…ν™•ν•œ 파일 지정을 ν¬ν•¨ν•˜λŠ” μž„μ˜μ˜ λ¬Έμžμ—΄ μ‹μž…λ‹ˆλ‹€. URL ν‘œκΈ°λ²•μ„ μ‚¬μš©ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

이 ν•¨μˆ˜λŠ” μ§€μ •ν•œ 파일의 속성을 ν™•μΈν•˜μ—¬ λ‹€μŒμ˜ 파일 속성을 식별할 수 있게 ν•˜λŠ” λΉ„νŠΈ νŒ¨ν„΄μ„ κ΅¬ν•©λ‹ˆλ‹€.

Error codes:

5 잘λͺ»λœ ν”„λ‘œμ‹œμ € ν˜ΈμΆœμž…λ‹ˆλ‹€.

53 νŒŒμΌμ„ 찾을 수 μ—†μŠ΅λ‹ˆλ‹€.

κ°’

Named constant

Value

Definition

ATTR_NORMAL

0

Normal files.

ATTR_READONLY

1

Read-only files.

ATTR_HIDDEN

2

Hidden file

ATTR_SYSTEM

4

System file

ATTR_VOLUME

8

Returns the name of the volume

ATTR_DIRECTORY

16

Returns the name of the directory only.

ATTR_ARCHIVE

32

File was changed since last backup (Archive bit).


속성 λ°”μ΄νŠΈμ˜ λΉ„νŠΈκ°€ μ„€μ •λ˜μ—ˆλŠ”μ§€ ν™•μΈν•˜λ €λ©΄ λ‹€μŒμ˜ 쿼리 λ©”μ†Œλ“œλ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.

예:


Sub ExampleSetGetAttr
On Error Goto ErrorHandler REM Define target for error-handler
 If Dir("C:\test",16)="" Then MkDir "C:\test"
 If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"
 SetAttr "c:\test\autoexec.sav" ,0
 FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"
 SetAttr "c:\test\autoexec.sav" ,1
 Print GetAttr( "c:\test\autoexec.sav" )
 End
ErrorHandler:
 Print Error
 End
End Sub

Please support us!