MCPcopy Create free account
hub / github.com/blues/note / fsObjectsToPath

Function fsObjectsToPath

lib/file.go:156–175  ·  view source on GitHub ↗

Convert two storage objects to a file path

(iContainer string, iObject string)

Source from the content-addressed store, hash-verified

154
155// Convert two storage objects to a file path
156func fsObjectsToPath(iContainer string, iObject string) string {
157 // Remove schemes
158 container := fsRemoveScheme(iContainer)
159 object := fsRemoveScheme(iObject)
160
161 // Extract the container name
162 container, _ = fsNamesFromFileStorageObject(container)
163
164 // Extract just the object name
165 _, object = fsNamesFromFileStorageObject(object)
166
167 // Construct them into a composite name
168 name := fsConstruct(container, object)
169
170 // Expand to path
171 path := fsPath(name)
172
173 // Done
174 return path
175}
176
177// It is quite catastrophic if we attempt to delete the entire file storage root, because for NTN
178// recovery is simply impossible. As such, we treat this like a 'bug check' and forbid the operation.

Callers 3

deleteMethod · 0.85
writeNotefileMethod · 0.85
readNotefileMethod · 0.85

Calls 4

fsRemoveSchemeFunction · 0.85
fsConstructFunction · 0.85
fsPathFunction · 0.85

Tested by

no test coverage detected