File: UnixFILE.schelp

package info (click to toggle)
supercollider 1%3A3.13.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,292 kB
  • sloc: cpp: 476,363; lisp: 84,680; ansic: 77,685; sh: 25,509; python: 7,909; makefile: 3,440; perl: 1,964; javascript: 974; xml: 826; java: 677; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (91 lines) | stat: -rw-r--r-- 2,451 bytes parent folder | download | duplicates (4)
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
class:: UnixFILE
summary:: An abstract class
related:: Classes/File, Classes/Pipe
categories:: Files

InstanceMethods::

private::prGetLine, addOpenFile

method::isOpen
Returns whether the file is open. An open request can fail if a file cannot be found for example. This method lets you test that the open call succeeded.

method::pos
Answer the current file position

argument::offset
an offset in bytes.

argument::origin
one of the following link::Classes/Integer::s:
definitionList::
## 0 || seek from beginning of file.
## 1 || seek from current position in file.
## 2 || seek from end of file.
::

method::write
Writes an item to the file.

argument::item
one of the following:
definitionList::
## link::Classes/Float:: ||
## link::Classes/Integer:: ||
## link::Classes/Char:: ||
## link::Classes/Color:: ||
## link::Classes/Symbol:: || writes the name of the Symbol as a C string.
## link::Classes/RawArray:: || write the bytes from any RawArray in big endian.
::

method::getLine
reads and returns a link::Classes/String:: up to lesser of next newline or 1023 chars.

method::getChar
read one byte and return as a link::Classes/Char::.

method::getInt8
read one byte and return as a link::Classes/Integer::.

method::getInt16
read two bytes and return as an link::Classes/Integer::.

method::getInt32
read four bytes and return as an link::Classes/Integer::.

method::getFloat
read four bytes and return as a link::Classes/Float::.

method::getDouble
read eight bytes and return as a link::Classes/Float::.

method::getPascalString
Reads the next byte as an unsigned integer N, then reads the following N bytes and returns them as a link::Classes/String::.

method::putChar
write a link::Classes/Char:: as one byte.

method::putInt8
write an link::Classes/Integer:: as one byte. That is a signed link::Classes/Integer:: value between -128 and 127.

method::putInt16
write an link::Classes/Integer:: as two bytes.

method::putInt32
write an link::Classes/Integer:: as four bytes.

method::putFloat
write a link::Classes/Float:: as four bytes.

method::putDouble
write a link::Classes/Float:: as eight bytes.

method::putString
write a null terminated link::Classes/String::.

method::putPascalString
Writes code::aString:: preceded by its length represented as a single byte.
Throws an error if code::aString:: is longer than 255 characters.

method::putString0
Writes code::aString:: followed by a zero byte, like a null-terminated C string.