rclone/cmd/siginfo_darwin.go

24 lines
348 B
Go
Raw Permalink Normal View History

2018-05-14 02:24:56 +08:00
//+build darwin
package cmd
import (
"log"
"os"
"os/signal"
"syscall"
"github.com/ncw/rclone/fs/accounting"
)
// SigInfoHandler creates SigInfo handler
func SigInfoHandler() {
signals := make(chan os.Signal, 1)
signal.Notify(signals, syscall.SIGINFO)
go func() {
for range signals {
log.Printf("%v\n", accounting.Stats)
}
}()
}