MCPcopy
hub / github.com/valyala/fasthttp / newCompressedFSFile

Method newCompressedFSFile

fs.go:1837–1848  ·  view source on GitHub ↗
(filePath, fileEncoding string)

Source from the content-addressed store, hash-verified

1835}
1836
1837func (h *fsHandler) newCompressedFSFile(filePath, fileEncoding string) (*fsFile, error) {
1838 f, err := h.filesystem.Open(filePath)
1839 if err != nil {
1840 return nil, fmt.Errorf("cannot open compressed file %q: %w", filePath, err)
1841 }
1842 fileInfo, err := f.Stat()
1843 if err != nil {
1844 _ = f.Close()
1845 return nil, fmt.Errorf("cannot obtain info for compressed file %q: %w", filePath, err)
1846 }
1847 return h.newFSFile(f, fileInfo, true, filePath, fileEncoding)
1848}
1849
1850func (h *fsHandler) openFSFile(filePath string, mustCompress bool, fileEncoding string) (*fsFile, error) {
1851 filePathOriginal := filePath

Callers 1

compressFileNolockMethod · 0.95

Calls 4

newFSFileMethod · 0.95
OpenMethod · 0.80
CloseMethod · 0.65
StatMethod · 0.45

Tested by

no test coverage detected