mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Fix recording filename for Windows.
This commit is contained in:
parent
6969ae7d68
commit
159a9b8147
1 changed files with 7 additions and 1 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -196,7 +197,12 @@ func (conn *diskConn) Close() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func openDiskFile(directory, label string) (*os.File, 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 != "" {
|
if label != "" {
|
||||||
filename = filename + "-" + label
|
filename = filename + "-" + label
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue