1IO.open(3kaya) Kaya module reference IO.open(3kaya)
2
3
4
6 IO::open - Open a file.
7
9 File open( String fname, [FileMode] mode )
10
12 fname The name of the file
13
14 mode A list of file modes
15
17 Open the named file with the specified file modes. Not all combinations
18 of modes are legal, and an IO.InvalidMode (3kaya) Exception will be
19 thrown if an illegal mode is selected. A IO.FileError (3kaya) Exception
20 will be thrown if opening fails for any other reason. Legal mode combiā
21 nations are:
22
23
24 - [Read,Write] : read and write to any point in the file
25
26
27 - [Read,Append] : read from any point in the file, write to the end only
28 (creating the file if it does not exist)
29
30
31 - [Read] : read from any point in the file
32
33
34 - [Write] : write to any point in the file, creating the file if it does
35 not exist, and truncating it otherwise.
36
37
38 - [Append] : write to the end of the file, creating the file if it
39 doesn't exist.
40
41 Binary can be added to any of the combinations above to open the file
42 in binary mode on Windows (it has no effect on POSIX platforms).
43
45 Kaya standard library by Edwin Brady, Chris Morris and others
46 (kaya@kayalang.org). For further information see http://kayalang.org/
47
49 The Kaya standard library is free software; you can redistribute it
50 and/or modify it under the terms of the GNU Lesser General Public
51 License (version 2.1 or any later version) as published by the Free
52 Software Foundation.
53
55 IO.close (3kaya)
56 IO.reopen (3kaya)
57
58
59
60Kaya December 2010 IO.open(3kaya)