github.com/hanwen/go-fuse@v1.0.0/fuse/attr_linux.go (about) 1 // Copyright 2016 the Go-FUSE Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package fuse 6 7 import ( 8 "syscall" 9 ) 10 11 func (a *Attr) FromStat(s *syscall.Stat_t) { 12 a.Ino = uint64(s.Ino) 13 a.Size = uint64(s.Size) 14 a.Blocks = uint64(s.Blocks) 15 a.Atime = uint64(s.Atim.Sec) 16 a.Atimensec = uint32(s.Atim.Nsec) 17 a.Mtime = uint64(s.Mtim.Sec) 18 a.Mtimensec = uint32(s.Mtim.Nsec) 19 a.Ctime = uint64(s.Ctim.Sec) 20 a.Ctimensec = uint32(s.Ctim.Nsec) 21 a.Mode = s.Mode 22 a.Nlink = uint32(s.Nlink) 23 a.Uid = uint32(s.Uid) 24 a.Gid = uint32(s.Gid) 25 a.Rdev = uint32(s.Rdev) 26 a.Blksize = uint32(s.Blksize) 27 }