MCPcopy Create free account
hub / github.com/apecloud/myduckserver / createEmptyFile

Function createEmptyFile

binlogreplication/binlog_metadata_persistence.go:146–154  ·  view source on GitHub ↗

createEmptyFile creates an empty file at |fullFilepath| if a file does not exist already. If a file does exist at that path, no action is taken.

(fullFilepath string)

Source from the content-addressed store, hash-verified

144// createEmptyFile creates an empty file at |fullFilepath| if a file does not exist already. If a file does exist
145// at that path, no action is taken.
146func createEmptyFile(fullFilepath string) (err error) {
147 _, err = os.Stat(fullFilepath)
148 if os.IsNotExist(err) {
149 var emptyFile *os.File
150 emptyFile, err = os.Create(fullFilepath)
151 defer emptyFile.Close()
152 }
153 return err
154}

Callers 1

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected