FileGetAttrib

파일이나 폴더가 읽기 전용인지, 숨어 있는지 등등을 보고합니다.

FileGetAttrib, OutputVar , Filename

매개변수

OutputVar

The name of the output variable in which to store the retrieved text.

Filename

목표 파일의 이름, 절대 경로를 지정하지 않으면 %A_WorkingDir%에 있다고 간주됩니다. 생략하면, 가장 안쪽 파일-회돌이에 싸인 현재 파일이 사용됩니다. Unlike FileExist(), this must be a true filename, not a pattern.

에러 처리

[v1.1.04+]: 이 명령어는 실패하면 예외를 던질 수 있습니다. 더 자세한 정보는 실행시간 에러를 참조하십시오.

ErrorLevel은 문제가 있으면 1, 그렇지 않으면 0이 설정됩니다.

A_LastError는 운영 체제의 GetLastError() 함수의 결과가 설정됩니다.

논평

반환된 문자열에는 다음 "RASHNDOCT" 문자열의 부문자열이 포함됩니다:

특정 속성이 열람된 문자열에 존재하는지 점검하려면, 다음 예제를 따르십시오:

FileGetAttrib, Attributes, C:\My File.txt
if InStr(Attributes, "H")
    MsgBox The file is hidden.

관련하여 한 마디 하면, 파일의 8.3 짧은 이름을 열람하려면, 다음 예제를 따르십시오:

Loop, C:\My Documents\Address List.txt
    ShortPathName := A_LoopFileShortPath  ; 결과는 다음과 비슷합니다: C:\MYDOCU~1\ADDRES~1.txt

비슷한 방법으로 8.3 짧은 이름의 긴 이름을 얻을 수 있습니다.

FileExist(), FileSetAttrib, FileGetTime, FileSetTime, FileGetSize, FileGetVersion, 파일-회돌이

예제

Stores the attribute letters of a directory in OutputVar. Note that existing directories always have the attribute letter D.

FileGetAttrib, OutputVar, C:\New Folder