mirror of
				https://github.com/restic/restic.git
				synced 2025-10-31 05:10:58 +00:00 
			
		
		
		
	
		
			
	
	
		
			22 lines
		
	
	
	
		
			436 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			22 lines
		
	
	
	
		
			436 B
		
	
	
	
		
			Go
		
	
	
	
	
	
|   | //go:build !linux && unix | ||
|  | 
 | ||
|  | package fs | ||
|  | 
 | ||
|  | import ( | ||
|  | 	"syscall" | ||
|  | 
 | ||
|  | 	"github.com/restic/restic/internal/restic" | ||
|  | ) | ||
|  | 
 | ||
|  | // utimesNano is like syscall.UtimesNano, except that it skips symlinks. | ||
|  | func utimesNano(path string, atime, mtime int64, typ restic.NodeType) error { | ||
|  | 	if typ == restic.NodeTypeSymlink { | ||
|  | 		return nil | ||
|  | 	} | ||
|  | 
 | ||
|  | 	return syscall.UtimesNano(path, []syscall.Timespec{ | ||
|  | 		syscall.NsecToTimespec(atime), | ||
|  | 		syscall.NsecToTimespec(mtime), | ||
|  | 	}) | ||
|  | } |