MCPcopy Create free account
hub / github.com/timelinize/timelinize / openInteractiveGraphDataFile

Method openInteractiveGraphDataFile

timeline/interactive.go:143–158  ·  view source on GitHub ↗
(g *Graph)

Source from the content-addressed store, hash-verified

141}
142
143func (p *processor) openInteractiveGraphDataFile(g *Graph) (*os.File, error) {
144 // We store interactive graph data files, temporarily while the user is
145 // interacting with the graph, somewhat deep in the system temp folder.
146 // It's in a system temp folder because import jobs are not typically
147 // portable; especially starting on one system and continuing on another,
148 // though I guess we could simply change the path to be something within
149 // the timeline if desired. Still, this seems more proper at least for now.
150 tmpFilePath := filepath.Join(p.tempGraphFolder(), g.ProcessingID+".graph.data")
151
152 // ensure folder tree exists or we're gonna have a bad time
153 if err := os.MkdirAll(filepath.Dir(tmpFilePath), 0700); err != nil {
154 return nil, err
155 }
156
157 return os.Create(tmpFilePath)
158}
159
160func (p *processor) tempGraphFolder() string {
161 return filepath.Join(

Callers 1

Calls 2

tempGraphFolderMethod · 0.95
DirMethod · 0.80

Tested by

no test coverage detected