MCPcopy Index your code
hub / github.com/Shopify/go-lua / forceOpen

Function forceOpen

io.go:50–59  ·  view source on GitHub ↗
(l *State, name, mode string)

Source from the content-addressed store, hash-verified

48}
49
50func forceOpen(l *State, name, mode string) {
51 s := newFile(l)
52 flags, err := flags(mode)
53 if err == nil {
54 s.f, err = os.OpenFile(name, flags, 0666)
55 }
56 if err != nil {
57 Errorf(l, fmt.Sprintf("cannot open file '%s' (%s)", name, err.Error()))
58 }
59}
60
61func ioFileHelper(name, mode string) Function {
62 return func(l *State) int {

Callers 2

ioFileHelperFunction · 0.85
io.goFile · 0.85

Calls 4

newFileFunction · 0.85
flagsFunction · 0.85
ErrorfFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected