(l *State)
| 19 | func toStream(l *State) *stream { return CheckUserData(l, 1, fileHandle).(*stream) } |
| 20 | |
| 21 | func toFile(l *State) *os.File { |
| 22 | s := toStream(l) |
| 23 | if s.close == nil { |
| 24 | Errorf(l, "attempt to use a closed file") |
| 25 | } |
| 26 | l.assert(s.f != nil) |
| 27 | return s.f |
| 28 | } |
| 29 | |
| 30 | func newStream(l *State, f *os.File, close Function) *stream { |
| 31 | s := &stream{f: f, close: close} |