Files
Reims-Go/internal/guesttools/file_sync_identity_windows.go
T

17 lines
410 B
Go

package guesttools
import (
"fmt"
"os"
"syscall"
)
func sharedDirectoryID(dir *os.File) (string, error) {
var info syscall.ByHandleFileInformation
if err := syscall.GetFileInformationByHandle(syscall.Handle(dir.Fd()), &info); err != nil {
return "", err
}
return fmt.Sprintf("%x:%08x%08x:%x", info.VolumeSerialNumber, info.FileIndexHigh,
info.FileIndexLow, info.CreationTime.Nanoseconds()), nil
}