From dbb964ffd47dd73cb452ae7b5420d3f9bae31d29 Mon Sep 17 00:00:00 2001 From: tomas Date: Tue, 14 Mar 2006 15:03:34 +0000 Subject: Standardizing the return values in case of error --- doc/us/manual.html | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'doc/us/manual.html') diff --git a/doc/us/manual.html b/doc/us/manual.html index af8beae..319d6c5 100644 --- a/doc/us/manual.html +++ b/doc/us/manual.html @@ -85,12 +85,15 @@ The compiled binary should be copied to a directory in your

Reference

-

LuaFileSystem offers the following functions:

+

+LuaFileSystem offers the following functions: +

lfs.attributes (filepath [, aname])
Returns a table with the file attributes corresponding to - filepath. + filepath (or nil followed by an error message + in case of error). If the second optional argument is given, then only the value of the named attribute is returned (this use is equivalent to lfs.attributes(filepath).aname, but the table is not created @@ -155,8 +158,12 @@ The compiled binary should be copied to a directory in your plus an error string.
lfs.dir (path)
-
Lua iterator over the entries of a given directory. Raises an - error if path is not a directory.
+
+ Lua iterator over the entries of a given directory. + Each time the iterator is called it returns a string with an entry of the + directory; nil is returned when there is no more entries. + Raises an error if path is not a directory. +
lfs.lock (filehandle, mode[, start[, length]])
Locks a file or a part of it. This function works on open files; the @@ -166,20 +173,21 @@ The compiled binary should be copied to a directory in your write/exclusive lock). The optional arguments start and length can be used to specify a starting point and its length; both should be numbers.
- Returns a boolean indicating if the operation was successful; in - case of error, it returns false plus an error string. + Returns true if the operation was successful; in + case of error, it returns nil plus an error string.
lfs.mkdir (dirname)
Creates a new directory. The argument is the name of the new directory.
- Returns a boolean indicating whether the operation succeeds or not - (in this case, an error string is returned too).
+ Returns true if the operation was successful; + in case of error, it returns nil plus an error string. +
lfs.rmdir (dirname)
Removes an existing directory. The argument is the name of the directory.
- Returns a boolean indicating whether the operation succeeds or not - (in this case, an error string is returned too).
+ Returns true if the operation was successful; + in case of error, it returns nil plus an error string.
lfs.touch (filepath [, atime [, mtime]])
Set access and modification times of a file. This function is @@ -188,10 +196,11 @@ The compiled binary should be copied to a directory in your and the third argument (mtime) is the modification time. Both times are provided in seconds (which should be generated with Lua standard function os.date). - If the modifition time is omitted, the access time provided is used; + If the modification time is omitted, the access time provided is used; if both times are omitted, the current time is used.
- Returns a boolean indicating whether the operation succeeded or not - (followed by an error string when it fails).
+ Returns true if the operation was successful; + in case of error, it returns nil plus an error string. +
lfs.unlock (filehandle[, start[, length]])
Unlocks a file or a part of it. This function works on @@ -199,9 +208,9 @@ The compiled binary should be copied to a directory in your argument. The optional arguments start and length can be used to specify a starting point and its length; both should be numbers.
- Returns a boolean indicating if the operation was successful; in - case of error, it returns false plus a string - describing the error.
+ Returns true if the operation was successful; + in case of error, it returns nil plus an error string. +
@@ -211,7 +220,7 @@ The compiled binary should be copied to a directory in your

Valid XHTML 1.0!

-

$Id: manual.html,v 1.28 2006/03/14 13:16:18 tomas Exp $

+

$Id: manual.html,v 1.29 2006/03/14 15:03:34 tomas Exp $

-- cgit v1.2.3-55-g6feb