diff options
author | tomas <tomas> | 2005-01-24 10:59:58 +0000 |
---|---|---|
committer | tomas <tomas> | 2005-01-24 10:59:58 +0000 |
commit | 5f942164a0cf9fd11545fffb5e54e446bd42ecd4 (patch) | |
tree | 25cb2f9b30926ac2050c4cf855899c7b03ab370c /doc/us/manual.html | |
parent | 2540f6cbdb94ba60fe2ef94f12fc85f60c8ce767 (diff) | |
download | luafilesystem-5f942164a0cf9fd11545fffb5e54e446bd42ecd4.tar.gz luafilesystem-5f942164a0cf9fd11545fffb5e54e446bd42ecd4.tar.bz2 luafilesystem-5f942164a0cf9fd11545fffb5e54e446bd42ecd4.zip |
Acrescimo de documentacao da lfs.touch.
Adaptacao para a versao 1.1.
Diffstat (limited to 'doc/us/manual.html')
-rw-r--r-- | doc/us/manual.html | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/doc/us/manual.html b/doc/us/manual.html index 0d9ab61..26a2192 100644 --- a/doc/us/manual.html +++ b/doc/us/manual.html | |||
@@ -53,8 +53,7 @@ systems offered by the standard Lua distribution.</p> | |||
53 | <p>LuaFileSystem offers the following functions:</p> | 53 | <p>LuaFileSystem offers the following functions:</p> |
54 | 54 | ||
55 | <ul> | 55 | <ul> |
56 | <li style="list-style: none"><a name="attributes"></a></li> | 56 | <a name="attributes"></a> |
57 | |||
58 | <li><b><tt>lfs.attributes (filepath)</tt></b><br> | 57 | <li><b><tt>lfs.attributes (filepath)</tt></b><br> |
59 | Obtains the file attributes. The attributes are: | 58 | Obtains the file attributes. The attributes are: |
60 | 59 | ||
@@ -77,25 +76,31 @@ on;<br> | |||
77 | <i>blksize</i>, optimal file system I/O blocksize; (Unix only)<br> | 76 | <i>blksize</i>, optimal file system I/O blocksize; (Unix only)<br> |
78 | </div> | 77 | </div> |
79 | 78 | ||
80 | Returns a table with file attributes described above. <a name= | 79 | Returns a table with file attributes described above. |
81 | "chdir"></a></li> | 80 | </li> |
82 | 81 | ||
82 | <a name="chdir"></a> | ||
83 | <li><b><tt>lfs.chdir (path)</tt></b><br> | 83 | <li><b><tt>lfs.chdir (path)</tt></b><br> |
84 | Changes the current working directory to the given | 84 | Changes the current working directory to the given |
85 | <tt>path</tt>.<br> | 85 | <tt>path</tt>.<br> |
86 | Returns <tt>true</tt> in case of success or <tt>nil</tt> plus an | 86 | Returns <tt>true</tt> in case of success or <tt>nil</tt> plus an |
87 | error string. <a name="getcwd"></a></li> | 87 | error string. |
88 | </li> | ||
88 | 89 | ||
90 | <a name="getcwd"></a> | ||
89 | <li><b><tt>lfs.currentdir ()</tt></b><br> | 91 | <li><b><tt>lfs.currentdir ()</tt></b><br> |
90 | Returns a string with the current working directory or | 92 | Returns a string with the current working directory or |
91 | <code>nil</code> plus an error string. <a name="dir"></a></li> | 93 | <code>nil</code> plus an error string. |
94 | </li> | ||
92 | 95 | ||
96 | <a name="dir"></a> | ||
93 | <li><b><tt>lfs.dir (path)</tt></b><br> | 97 | <li><b><tt>lfs.dir (path)</tt></b><br> |
94 | Lua iterator over the entries of a given directory. Raises an | 98 | Lua iterator over the entries of a given directory. Raises an |
95 | error if <tt>path</tt> is not a directory. <a name="lock"></a></li> | 99 | error if <tt>path</tt> is not a directory. |
100 | </li> | ||
96 | 101 | ||
97 | <li><b><tt>lfs.lock (filehandle, mode[, start[, | 102 | <a name="lock"></a> |
98 | length]])</tt></b><br> | 103 | <li><b><tt>lfs.lock (filehandle, mode[, start[, length]])</tt></b><br> |
99 | Locks a file or a part of it. This function works on <em>open | 104 | Locks a file or a part of it. This function works on <em>open |
100 | files</em>; the file handle should be specified as the first | 105 | files</em>; the file handle should be specified as the first |
101 | argument. The string <code>mode</code> could be either | 106 | argument. The string <code>mode</code> could be either |
@@ -105,15 +110,32 @@ and <code>length</code> can be used to specify a starting point and | |||
105 | its length; both should be numbers.<br> | 110 | its length; both should be numbers.<br> |
106 | Returns a boolean indicating if the operation was successful; in | 111 | Returns a boolean indicating if the operation was successful; in |
107 | case of error, it returns <code>false</code> plus an error string. | 112 | case of error, it returns <code>false</code> plus an error string. |
108 | <a name="mkdir"></a></li> | 113 | </li> |
109 | 114 | ||
115 | <a name="mkdir"></a> | ||
110 | <li><b><tt>lfs.mkdir (dirname)</tt></b><br> | 116 | <li><b><tt>lfs.mkdir (dirname)</tt></b><br> |
111 | Creates a new directory. The argument is the name of the new | 117 | Creates a new directory. The argument is the name of the new |
112 | directory.<br> | 118 | directory.<br> |
113 | Returns a boolean indicating whether the operation succeeds or not | 119 | Returns a boolean indicating whether the operation succeeds or not |
114 | (in this case, an error string is returned too). <a name= | 120 | (in this case, an error string is returned too). |
115 | "unlock"></a></li> | 121 | </li> |
116 | 122 | ||
123 | <a name="touch"></a> | ||
124 | <li><b><tt>lfs.touch (filepath [, atime [, mtime]])</tt></b><br> | ||
125 | Set access and modification times of a file. | ||
126 | This function is a bind to <tt>utime</tt> function. | ||
127 | The first argument is the filename, | ||
128 | the second argument is the access time, | ||
129 | and the third argument is the modification time. | ||
130 | Both times are provided in seconds (which should be generated with | ||
131 | Lua standard function <tt>os.date</tt>). | ||
132 | If the modifition time is omitted, the access time provided is used; | ||
133 | if both times are omitted, the current time is used.<br> | ||
134 | Returns a boolean indicating whethet the operation succeeds or not | ||
135 | (followed by an error string in case it fails). | ||
136 | </li> | ||
137 | |||
138 | <a name="unlock"></a> | ||
117 | <li><b><tt>lfs.unlock (filehandle[, start[, length]])</tt></b><br> | 139 | <li><b><tt>lfs.unlock (filehandle[, start[, length]])</tt></b><br> |
118 | Unlocks a file or a part of it. This function works on <em>open | 140 | Unlocks a file or a part of it. This function works on <em>open |
119 | files</em>; the file handle should be specified as the first | 141 | files</em>; the file handle should be specified as the first |
@@ -126,7 +148,6 @@ describing the error.</li> | |||
126 | </ul> | 148 | </ul> |
127 | 149 | ||
128 | <a name="example"></a> | 150 | <a name="example"></a> |
129 | |||
130 | <h2>Example</h2> | 151 | <h2>Example</h2> |
131 | 152 | ||
132 | <pre> | 153 | <pre> |