mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 16:34:30 +01:00
ce3b65e6dc
* abcdefghijklmnopqrstuvwxyz * accounting * additional * allowed * almost * already * appropriately * arise * bandwidth * behave * bidirectional * brackets * cached * characters * cloud * committing * concatenating * configured * constructs * current * cutoff * deferred * different * directory * disposition * dropbox * either way * error * excess * experiments * explicitly * externally * files * github * gzipped * hierarchies * huffman * hyphen * implicitly * independent * insensitive * integrity * libraries * literally * metadata * mimics * missing * modification * multipart * multiple * nightmare * nonexistent * number * obscure * ourselves * overridden * potatoes * preexisting * priority * received * remote * replacement * represents * reproducibility * response * satisfies * sensitive * separately * separator * specifying * string * successful * synchronization * syncing * šenfeld * take * temporarily * testcontents * that * the * themselves * throttling * timeout * transaction * transferred * unnecessary * using * webbrowser * which * with * workspace Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
29 lines
511 B
Go
29 lines
511 B
Go
//go:build windows
|
|
// +build windows
|
|
|
|
package local
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
"time"
|
|
)
|
|
|
|
const haveSetBTime = true
|
|
|
|
// setBTime sets the birth time of the file passed in
|
|
func setBTime(name string, btime time.Time) (err error) {
|
|
h, err := syscall.Open(name, os.O_RDWR, 0755)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer func() {
|
|
closeErr := syscall.Close(h)
|
|
if err == nil {
|
|
err = closeErr
|
|
}
|
|
}()
|
|
bFileTime := syscall.NsecToFiletime(btime.UnixNano())
|
|
return syscall.SetFileTime(h, &bFileTime, nil, nil)
|
|
}
|