-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtdu_generic.go
55 lines (45 loc) · 1.1 KB
/
tdu_generic.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// +build !linux
// +build !windows
// +build !freebsd
/* Top Disk Usage.
* Copyright (C) 2019 Joseph Paul <joseph.paul1@gmx.com>
* https://github.com/josephpaul0/tdu
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
/* Generic functions for non-Linux OS */
package main
import (
"fmt"
)
func osInit() bool {
return true
}
func osEnd() bool {
return true
}
// Console width is fixed on other systems
func getTtyWidth(sc *s_scan) int {
return 80
}
func initTty(sc *sc_scan) {} // OS Specific
func printAlert(sc *s_scan, msg string) {
fmt.Printf(msg)
}
func printProgress(sc *s_scan) {
n := sc.nErrors + sc.nItems
fmt.Printf(" [.... scanning... %6d ....]\r", n)
}
// Disk usage is inaccurate because appropriate syscall is not yet implemented
func sysStat(sc *s_scan, f *file) error {
f.deviceId = 0
f.inode = 0
f.nLinks = 0
f.blockSize = 4096
f.nBlocks512 = 0
f.diskUsage = f.size
return nil
}