- Open Inkscape.
- Choose "File - Import" to import a bitmap file.
- Choose to "embed" the image.
- Select the image with the select tool (↖).
- Select Path - Trace Bitmap... for settings (below shown for 2 colors = "Scans"):

- Select "Update" for a preview until settings are fine.
- Start tracing with "OK".
package main import ( "fmt" "syscall" ) func main() { fmt.Println(DiskUsage("./")) } func DiskUsage(path string) uint64 { fs := syscall.Statfs_t{} err := syscall.Statfs(path, &fs) if err != nil { return 0 } return fs.Bfree * uint64(fs.Bsize) } //All space = fs.Blocks * uint64(fs.Bsize) //Free space = fs.Bfree * uint64(fs.Bsize) //Used space= fs.All - disk.Free
评论
发表评论