diff options
| author | tomas <tomas> | 2004-11-05 10:37:29 +0000 |
|---|---|---|
| committer | tomas <tomas> | 2004-11-05 10:37:29 +0000 |
| commit | 2bc7cbf743631ab8317576b58e98159d3ca08dcc (patch) | |
| tree | ecc74bce9192691da1a53e73bb48eea7c434681d | |
| parent | 963ec467311dd5dee2d698b8731499e034a7faff (diff) | |
| download | luafilesystem-2bc7cbf743631ab8317576b58e98159d3ca08dcc.tar.gz luafilesystem-2bc7cbf743631ab8317576b58e98159d3ca08dcc.tar.bz2 luafilesystem-2bc7cbf743631ab8317576b58e98159d3ca08dcc.zip | |
Melhorias na documentacao.
| -rw-r--r-- | doc/us/manual.html | 44 | ||||
| -rw-r--r-- | src/lfs.c | 4 |
2 files changed, 33 insertions, 15 deletions
diff --git a/doc/us/manual.html b/doc/us/manual.html index 5ca685d..3afde68 100644 --- a/doc/us/manual.html +++ b/doc/us/manual.html | |||
| @@ -56,24 +56,41 @@ LuaFileSystem offers the following functions: | |||
| 56 | <ul> | 56 | <ul> |
| 57 | <a name="attributes"></a> | 57 | <a name="attributes"></a> |
| 58 | <li> <b><tt>lfs.attributes (filepath)</tt></b> <br> | 58 | <li> <b><tt>lfs.attributes (filepath)</tt></b> <br> |
| 59 | Returns a table with file attributes. | 59 | Obtains the file attributes. |
| 60 | The attributes are: | ||
| 61 | <ul> | ||
| 62 | <i>dev</i>, device inode resides on;<br> | ||
| 63 | <i>ino</i>, inode's number;<br> | ||
| 64 | <i>mode</i>, inode protection mode (<small>values could be | ||
| 65 | <tt>file</tt>, <tt>directory</tt>, <tt>link</tt>, <tt>socket</tt>, <tt>named pipe</tt>, <tt>char device</tt>, <tt>block device</tt> or <tt>other</tt></small>);<br> | ||
| 66 | <i>nlink</i>, number of hard links to the file;<br> | ||
| 67 | <i>uid</i>, user-id of owner;<br> | ||
| 68 | <i>gid</i>, group-id of owner;<br> | ||
| 69 | <i>rdev</i>, device type, for special file inode;<br> | ||
| 70 | <i>access</i>, time of last access;<br> | ||
| 71 | <i>modification</i>, time of last data modification;<br> | ||
| 72 | <i>change</i>, time of last file status change;<br> | ||
| 73 | <i>size</i>, file size, in bytes;<br> | ||
| 74 | <i>blocks</i>, block allocated for file;<br> | ||
| 75 | <i>blksize</i>, optimal file system I/O blocksize;<br> | ||
| 76 | </ul> | ||
| 77 | Returns a table with file attributes described above. | ||
| 60 | 78 | ||
| 61 | <a name="chdir"></a> | 79 | <a name="chdir"></a> |
| 62 | <li> <b><tt>lfs.chdir (path)</tt></b> <br> | 80 | <li> <b><tt>lfs.chdir (path)</tt></b> <br> |
| 63 | Changes the current | 81 | Changes the current working directory to the given <tt>path</tt>.<br> |
| 64 | working directory to the given <tt>path</tt>. | ||
| 65 | Returns <tt>true</tt> in case of success or <tt>nil</tt> plus an error | 82 | Returns <tt>true</tt> in case of success or <tt>nil</tt> plus an error |
| 66 | string. | 83 | string. |
| 67 | 84 | ||
| 68 | <a name="getcwd"></a> | 85 | <a name="getcwd"></a> |
| 69 | <li> <b><tt>lfs.currentdir ()</tt></b> <br> | 86 | <li> <b><tt>lfs.currentdir ()</tt></b> <br> |
| 70 | Returns the current | 87 | Returns a string with the current working directory or |
| 71 | working directory or <code>nil</code> plus an error string. | 88 | <code>nil</code> plus an error string. |
| 72 | 89 | ||
| 73 | <a name="dir"></a> | 90 | <a name="dir"></a> |
| 74 | <li> <b><tt>lfs.dir (path)</tt></b> <br> | 91 | <li> <b><tt>lfs.dir (path)</tt></b> <br> |
| 75 | Lua iterator over the entries | 92 | Lua iterator over the entries of a given directory. |
| 76 | of a given directory. | 93 | Raises an error if <tt>path</tt> is not a directory. |
| 77 | 94 | ||
| 78 | <a name="lock"></a> | 95 | <a name="lock"></a> |
| 79 | <li> <b><tt>lfs.lock (filehandle, mode[, start[, length]])</tt></b> <br> | 96 | <li> <b><tt>lfs.lock (filehandle, mode[, start[, length]])</tt></b> <br> |
| @@ -84,15 +101,16 @@ LuaFileSystem offers the following functions: | |||
| 84 | read/shared lock) or <code>w</code> (for a write/exclusive lock). | 101 | read/shared lock) or <code>w</code> (for a write/exclusive lock). |
| 85 | The optional arguments <code>start</code> and <code>length</code> can be | 102 | The optional arguments <code>start</code> and <code>length</code> can be |
| 86 | used to specify a starting point and its length; | 103 | used to specify a starting point and its length; |
| 87 | both should be numbers. | 104 | both should be numbers.<br> |
| 88 | Returns a boolean indicating if the operation was successful; | 105 | Returns a boolean indicating if the operation was successful; |
| 89 | in case of error, it returns <code>false</code> plus an error string. | 106 | in case of error, it returns <code>false</code> plus an error string. |
| 90 | 107 | ||
| 91 | <a name="mkdir"></a> | 108 | <a name="mkdir"></a> |
| 92 | <li> <b><tt>lfs.mkdir (dirname)</tt></b> <br> | 109 | <li> <b><tt>lfs.mkdir (dirname)</tt></b> <br> |
| 93 | Creates a new directory. | 110 | Creates a new directory. |
| 94 | The argument is the name of the new directory. | 111 | The argument is the name of the new directory.<br> |
| 95 | Returns a boolean indicating whether the operation succeeds or not. | 112 | Returns a boolean indicating whether the operation succeeds or not |
| 113 | (in this case, an error string is returned too). | ||
| 96 | 114 | ||
| 97 | <a name="unlock"></a> | 115 | <a name="unlock"></a> |
| 98 | <li> <b><tt>lfs.unlock (filehandle[, start[, length]])</tt></b> <br> | 116 | <li> <b><tt>lfs.unlock (filehandle[, start[, length]])</tt></b> <br> |
| @@ -101,8 +119,8 @@ LuaFileSystem offers the following functions: | |||
| 101 | the file handle should be specified as the first argument. | 119 | the file handle should be specified as the first argument. |
| 102 | The optional arguments <code>start</code> and <code>length</code> can be | 120 | The optional arguments <code>start</code> and <code>length</code> can be |
| 103 | used to specify a starting point and its length; | 121 | used to specify a starting point and its length; |
| 104 | both should be numbers. | 122 | both should be numbers.<br> |
| 105 | This function returns a boolean indicating if the operation was successful; | 123 | Returns a boolean indicating if the operation was successful; |
| 106 | in case of error, it returns <code>false</code> plus a string describing the | 124 | in case of error, it returns <code>false</code> plus a string describing the |
| 107 | error. | 125 | error. |
| 108 | 126 | ||
| @@ -167,7 +185,7 @@ attrdir (".") | |||
| 167 | 185 | ||
| 168 | <hr> | 186 | <hr> |
| 169 | <small> | 187 | <small> |
| 170 | $Id: manual.html,v 1.5 2004/11/01 15:27:13 tomas Exp $ | 188 | $Id: manual.html,v 1.6 2004/11/05 10:37:29 tomas Exp $ |
| 171 | </small> | 189 | </small> |
| 172 | 190 | ||
| 173 | </body> | 191 | </body> |
| @@ -9,7 +9,7 @@ | |||
| 9 | ** lfs.lock (fh, mode) | 9 | ** lfs.lock (fh, mode) |
| 10 | ** lfs.unlock (fh) | 10 | ** lfs.unlock (fh) |
| 11 | ** | 11 | ** |
| 12 | ** $Id: lfs.c,v 1.10 2004/11/04 22:21:28 tuler Exp $ | 12 | ** $Id: lfs.c,v 1.11 2004/11/05 10:37:29 tomas Exp $ |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <errno.h> | 15 | #include <errno.h> |
| @@ -403,7 +403,7 @@ static int file_info (lua_State *L) { | |||
| 403 | lua_pushliteral (L, "mode"); | 403 | lua_pushliteral (L, "mode"); |
| 404 | lua_pushstring (L, mode2string (info.st_mode)); | 404 | lua_pushstring (L, mode2string (info.st_mode)); |
| 405 | lua_rawset (L, -3); | 405 | lua_rawset (L, -3); |
| 406 | /* number or hard links to the file */ | 406 | /* number of hard links to the file */ |
| 407 | lua_pushliteral (L, "nlink"); | 407 | lua_pushliteral (L, "nlink"); |
| 408 | lua_pushnumber (L, (lua_Number)info.st_nlink); | 408 | lua_pushnumber (L, (lua_Number)info.st_nlink); |
| 409 | lua_rawset (L, -3); | 409 | lua_rawset (L, -3); |
