Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/doc/en/html/macro/command/getfileattr.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10870 - (show annotations) (download) (as text)
Wed Aug 23 14:17:40 2023 UTC (9 months ago) by nmaya
File MIME type: text/html
File size: 3143 byte(s)
外部へのリンクに target="_blank" を指定

chm を表示している hh.exe 外(標準のブラウザ?)で開くリンクになる
ticket #44049
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6 <title>getfileattr</title>
7 <meta http-equiv="Content-Style-Type" content="text/css">
8 <link rel="stylesheet" href="../../style.css" type="text/css">
9 </head>
10
11 <body>
12
13
14 <h1>getfileattr</h1>
15
16 <p>
17 Returns the attributes of a file or directory. <em>(version 4.69 or later)</em>
18 </p>
19
20 <pre class="macro-syntax">
21 getfileattr &lt;filename&gt;
22 </pre>
23
24 <h2>Parameters</h2>
25
26 <dl>
27 <dt class="macro">string &lt;filename&gt;</dt>
28 <dd>The file name or directory name</dd>
29 </dl>
30
31 <h2>Return Value</h2>
32
33 <dl>
34 <dt class="macro">System variable &lt;result&gt;</dt>
35 <dd>When this command fails, -1 is stored.<br>
36 When the command succeeds, the returned value is in the following:<br>
37 <table border="2">
38 <tr>
39 <th>Value</th>
40 <th>Meaning</th>
41 </tr>
42 <tr>
43 <td>$1</td>
44 <td>Read only</td>
45 </tr>
46 <tr>
47 <td>$2</td>
48 <td>Hidden</td>
49 </tr>
50 <tr>
51 <td>$4</td>
52 <td>The operating system uses a part of, or uses exclusively</td>
53 </tr>
54 <tr>
55 <td>$10</td>
56 <td>Directory</td>
57 </tr>
58 <tr>
59 <td>$20</td>
60 <td>Archive</td>
61 </tr>
62 <tr>
63 <td>$80</td>
64 <td>Not have other attributes set</td>
65 </tr>
66 <tr>
67 <td>$100</td>
68 <td>Temporary</td>
69 </tr>
70 <tr>
71 <td>$200</td>
72 <td>Sparse file</td>
73 </tr>
74 <tr>
75 <td>$400</td>
76 <td>Has an associated reparse point, or a file that is a symbolic link</td>
77 </tr>
78 <tr>
79 <td>$800</td>
80 <td>Compressed</td>
81 </tr>
82 <tr>
83 <td>$1000</td>
84 <td>Physically moved to offline storage(Windows 2000 or later)</td>
85 </tr>
86 <tr>
87 <td>$2000</td>
88 <td>Not to be indexed by the content indexing service(Windows 2000 or later)</td>
89 </tr>
90 <tr>
91 <td>$4000</td>
92 <td>Encrypted</td>
93 </tr>
94 </table>
95 </dd>
96 </dl>
97
98 <h2>Example</h2>
99
100 <pre class="macro-example">
101 file = 'c:\test.txt'
102 getfileattr file
103 if result &lt;&gt; -1 then
104 if result &amp; $1 &gt; 0 then
105 messagebox 'This file has readonly attribute.' file
106 endif
107 endif
108 </pre>
109
110 <pre class="macro-example">
111 name = "C:\test"
112
113 getfileattr name
114
115 if result &lt; 0 then
116 messagebox "Not found" name
117 elseif result &amp; $10 then
118 messagebox "Directory" name
119 else
120 messagebox "File" name
121 endif
122 </pre>
123
124 <h2>See also</h2>
125 <ul>
126 <li><a href="setfileattr.html">setfileattr</a></li>
127 <li>MSDN Library <a href="http://msdn.microsoft.com/en-us/library/aa364944(v=VS.85).aspx" target="_blank">GetFileAttributes</a></li>
128 <li>MSDN Library <a href="http://msdn.microsoft.com/en-us/library/gg258117(v=VS.85).aspx" target="_blank">File Attribute Constants</a></li>
129 </ul>
130
131 </body>
132 </html>

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26