MCPcopy
hub / github.com/davyxu/tabtoy / WriteFile

Method WriteFile

v2/printer/util.go:36–48  ·  view source on GitHub ↗
(outfile string)

Source from the content-addressed store, hash-verified

34}
35
36func (self *Stream) WriteFile(outfile string) error {
37
38 // 自动创建目录
39 os.MkdirAll(filepath.Dir(outfile), 0755)
40
41 err := ioutil.WriteFile(outfile, self.buf.Bytes(), 0666)
42 if err != nil {
43 log.Errorf("%s, %v", i18n.String(i18n.Printer_OpenWriteOutputFileFailed), err.Error())
44 return err
45 }
46
47 return nil
48}
49
50func (self *Stream) WriteInt32(v int32) {
51

Callers 6

StartMethod · 0.80
OutputFunction · 0.80
OutputFunction · 0.80
OutputFunction · 0.80
OutputFunction · 0.80
WriteFileFunction · 0.80

Calls 3

StringFunction · 0.92
BytesMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected