This repository has been archived on 2026-07-15. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
drive/backend/scratch.go
Elijah 83e73b4d52
All checks were successful
Automated Container Build / build-and-push (push) Successful in 58s
Fox files not showing thumbnails in all documents section
2026-06-15 18:26:51 -07:00

25 lines
685 B
Go

package main
import (
"fmt"
"path/filepath"
"strings"
)
func main() {
storageDir := `C:\Users\Elijah\Desktop\Drive\data`
path1 := `C:\Users\Elijah\Desktop\Drive\data\test.docx`
path2 := `C:\Users\Elijah\Desktop\Drive\data\folder\test.docx`
relPath1, _ := filepath.Rel(storageDir, path1)
relPathSlash1 := filepath.ToSlash(relPath1)
relPath2, _ := filepath.Rel(storageDir, path2)
relPathSlash2 := filepath.ToSlash(relPath2)
fmt.Printf("Root file: %q -> %q\n", relPath1, relPathSlash1)
fmt.Printf("Sub file: %q -> %q\n", relPath2, relPathSlash2)
fmt.Printf("Clean . : %q\n", filepath.Clean("."))
fmt.Printf("Join . and file: %q\n", filepath.Join(".", "test.docx"))
}