MCPcopy Create free account
hub / github.com/ethstorage/es-node / OpenDataFile

Function OpenDataFile

ethstorage/data_file.go:116–125  ·  view source on GitHub ↗
(filename string)

Source from the content-addressed store, hash-verified

114}
115
116func OpenDataFile(filename string) (*DataFile, error) {
117 file, err := os.OpenFile(filename, os.O_RDWR, 0755)
118 if err != nil {
119 return nil, err
120 }
121 dataFile := &DataFile{
122 file: file,
123 }
124 return dataFile, dataFile.readHeader()
125}
126
127func (df *DataFile) Contains(chunkIdx uint64) bool {
128 return chunkIdx >= df.chunkIdxStart && chunkIdx < df.ChunkIdxEnd()

Callers 6

initShardManagerFunction · 0.92
createEthStorageFunction · 0.92
initStorageManagerMethod · 0.92
TestCreateDataFileFunction · 0.92
AddDataFileFromConfigFunction · 0.85
createEthStorageFunction · 0.85

Calls 1

readHeaderMethod · 0.95

Tested by 4

initShardManagerFunction · 0.74
createEthStorageFunction · 0.74
TestCreateDataFileFunction · 0.74
createEthStorageFunction · 0.68