diff --git a/src/cmd/tusd/data.go b/src/cmd/tusd/data.go new file mode 100644 index 0000000..788bdf7 --- /dev/null +++ b/src/cmd/tusd/data.go @@ -0,0 +1,33 @@ +package main + +// This is very simple for now and will be enhanced as needed. + +import ( + "os" + "path" +) + +var dataDir string + +func init() { + wd, err := os.Getwd() + if err != nil { + panic(err) + } + + dataDir = path.Join(wd, "tus_data") + if err := os.MkdirAll(dataDir, 0777); err != nil { + panic(err) + } +} + +func dataPath(fileId string) string { + return path.Join(dataDir, fileId) +} + +func logPath(fileId string) string { + return dataPath(fileId)+".log" +} + +func initDataFile(id string, size int) { +}