1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-09 18:25:58 +01:00

Fix recording filename for Windows.

This commit is contained in:
Juliusz Chroboczek 2020-12-23 23:13:22 +01:00
parent 6969ae7d68
commit 159a9b8147

View file

@ -8,6 +8,7 @@ import (
"log"
"os"
"path/filepath"
"runtime"
"strings"
"sync"
"time"
@ -196,7 +197,12 @@ func (conn *diskConn) Close() error {
}
func openDiskFile(directory, label string) (*os.File, error) {
filename := time.Now().Format("2006-01-02T15:04:05.000")
filenameFormat := "2006-01-02T15:04:05.000"
if runtime.GOOS == "windows" {
filenameFormat = "2006-01-02T15-04-05-000"
}
filename := time.Now().Format(filenameFormat)
if label != "" {
filename = filename + "-" + label
}