MCPcopy Index your code
hub / github.com/CodisLabs/codis / newTempFile

Method newTempFile

pkg/models/fs/fsclient.go:128–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126}
127
128func (c *Client) newTempFile() (*os.File, error) {
129 if err := mkdirAll(c.TempDir); err != nil {
130 return nil, err
131 }
132 prefix := fmt.Sprintf("%d.", int(time.Now().Unix()))
133 f, err := ioutil.TempFile(c.TempDir, prefix)
134 if err != nil {
135 return nil, errors.Trace(err)
136 }
137 return f, nil
138}
139
140func (c *Client) writeFile(realpath string, data []byte, noexists bool) error {
141 if noexists {

Callers 1

writeFileMethod · 0.95

Calls 1

mkdirAllFunction · 0.85

Tested by

no test coverage detected