ll_libload kernel, "Kernel32.dll"
ll_getproc GetFileAttributesA, "GetFileAttributesA", kernel
#module
#deffunc getattribute str
mref file, 32
mref stt, 64
ll_getptr file : ll_ret prm
ll_callfunc prm, 1, GetFileAttributesA@
ll_ret prm : stt = prm
return
#global
dim atr, 14
sdim atrname, 16, 14
atr = 0x0001, 0x0002, 0x0004, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000
atrname.0 = "読取専用", "隠し", "システム", "ディレクトリ", "アーカイブ", "予約済", "無"
atrname.7 = "一時", "スパース", "再解析", "圧縮", "オフライン", "高速検索対象外", "暗号化"
dialog "", 16, "属性取得対象のファイル"
if stat {
getattribute refstr
ha = stat
str ha, 16 + 4 // 4桁の16進数に変換
mes "属性合計値:0x" + ha
repeat 14
if atr.cnt & stat : mes "・" + atrname.cnt + "属性"
loop
}
stop
|