blob: ccabb2d9359a212f498c8e9174a38d160edaf41c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
<! See Copyright Notice in license.html>
<html>
<head>
<title>LuaFileSystem</title>
<style type="text/css">
ul { list-style-type: disc };
</style>
</head>
<body bgcolor="#FFFFFF">
<hr>
<center>
<table border=0 cellspacing=2 cellpadding=2>
<tr><td align=center><a href="http://www.keplerproject.org/luafilesystem">
<img border=0 alt="LuaFileSystem logo" src="luafilesystem.png"></a>
<tr><td align=center><big><b>LuaFileSystem Reference Manual</b></big>
<tr><td align=center valign=top>File system library for the
<a href="http://www.lua.org">Lua</a>
programming language
</table>
</center>
<p>
<center><small>
<a href="index.html">home</a> ·
<a href="#introduction">introduction</a> ·
<a href="#reference">reference</a> ·
<a href="#example">example</a>
</small></center>
<p>
<hr>
<a name="introduction"></a>
<h2>Introduction</h2>
<p>
LuaFileSystem is a <a href="http://www.lua.org">Lua</a> library
developed to complement the set of functions related to file systems offered
by the standard Lua distribution.
<p>
LuaFileSystem is free software and uses the same
<a href="license.html">license</a>
as Lua 5.0.
</p>
<a name="reference"></a>
<h2>Reference</h2>
<p>
LuaFileSystem offers the following functions:
<ul>
<a name="chdir"></a>
<li> <b><tt>luafilesystem.chdir (path)</tt></b> <br>
Changes the current
working directory to the given <tt>path</tt>.
<a name="getcwd"></a>
<li> <b><tt>luafilesystem.currentdir ()</tt></b> <br>
Returns the current
working directory or <code>nil</code> plus an error string.
<a name="dir"></a>
<li> <b><tt>luafilesystem.dir (path)</tt></b> <br>
Lua iterator over the entries
of a given directory.
<a name="lock"></a>
<li> <b><tt>luafilesystem.lock (filehandle, mode[, start[, length]])</tt></b> <br>
Locks a file or a part of it.
This function works on <em>open files</em>;
the file handle should be specified as the first argument.
The string <code>mode</code> could be either <code>r</code> (for a
read/shared lock) or <code>w</code> (for a write/exclusive lock).
The optional arguments <code>start</code> and <code>length</code> can be
used to specify a starting point and its length;
both should be numbers.
This function returns a boolean indicating if the operation was successful;
in case of error, it returns <code>false</code> plus a string describing the
error.
<a name="mkdir"></a>
<li> <b><tt>luafilesystem.mkdir (dirname)</tt></b> <br>
Creates a new directory.
The argument is the name of the new directory.
<a name="unlock"></a>
<li> <b><tt>luafilesystem.unlock (filehandle[, start[, length]])</tt></b> <br>
Unlocks a file or a part of it.
This function works on <em>open files</em>;
the file handle should be specified as the first argument.
The optional arguments <code>start</code> and <code>length</code> can be
used to specify a starting point and its length;
both should be numbers.
This function returns a boolean indicating if the operation was successful;
in case of error, it returns <code>false</code> plus a string describing the
error.
</ul>
<a name="example"></a>
<h2>Example</h2>
<a name="contents"></a>
<h2>Contents</h2>
<p>
<ul>
<li> <a href="#introduction">Introduction</a>
<li> <a href="#reference">Reference</a>
<ul>
<li> <a href="#chdir">chdir</a>
<li> <a href="#currentdir">currentdir</a>
<li> <a href="#dir">dir</a>
<li> <a href="#lock">lock</a>
<li> <a href="#mkdir">mkdir</a>
<li> <a href="#unlock">unlock</a>
</ul>
<li> <a href="#examples">Examples</a>
</ul>
</p>
<p>
<center><small>
<a href="index.html">home</a> ·
<a href="#introduction">introduction</a> ·
<a href="#reference">reference</a> ·
<a href="#example">example</a>
</small></center>
<p>
<hr>
<small>
$Id: manual.html,v 1.1.1.1 2004/07/27 14:15:24 tomas Exp $
</small>
</body>
</html>
|