pkg.re/essentialkaos/ek.10@v12.41.0+incompatible/fsutil/fs_windows.go (about) 1 // Package fsutil provides methods for working with files on POSIX compatible systems 2 package fsutil 3 4 // ////////////////////////////////////////////////////////////////////////////////// // 5 // // 6 // Copyright (c) 2022 ESSENTIAL KAOS // 7 // Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> // 8 // // 9 // ////////////////////////////////////////////////////////////////////////////////// // 10 11 import ( 12 "errors" 13 "os" 14 "time" 15 ) 16 17 // ////////////////////////////////////////////////////////////////////////////////// // 18 19 const ( 20 S_IFMT = 0 21 S_IFSOCK = 0 22 S_IFLNK = 0 23 S_IFREG = 0 24 S_IFBLK = 0 25 S_IFDIR = 0 26 S_IFCHR = 0 27 S_IFIFO = 0 28 S_ISUID = 0 29 S_ISGID = 0 30 S_ISVTX = 0 31 S_IRWXU = 0 32 S_IRUSR = 0 33 S_IWUSR = 0 34 S_IXUSR = 0 35 S_IRWXG = 0 36 S_IRGRP = 0 37 S_IWGRP = 0 38 S_IXGRP = 0 39 S_IRWXO = 0 40 S_IROTH = 0 41 S_IWOTH = 0 42 S_IXOTH = 0 43 ) 44 45 // ////////////////////////////////////////////////////////////////////////////////// // 46 47 // ❗ ErrEmptyPath can be returned by different methods if given path is empty and 48 // can't be used 49 var ErrEmptyPath = errors.New("Path is empty") 50 51 // ////////////////////////////////////////////////////////////////////////////////// // 52 53 // ❗ CheckPerms check many props at once 54 func CheckPerms(perms, path string) bool { 55 panic("UNSUPPORTED") 56 return false 57 } 58 59 // ❗ ValidatePerms validates permissions for file or directory 60 func ValidatePerms(props, path string) error { 61 panic("UNSUPPORTED") 62 return nil 63 } 64 65 // ❗ ProperPath returns the first proper path from a given slice 66 func ProperPath(props string, paths []string) string { 67 panic("UNSUPPORTED") 68 return "" 69 } 70 71 // ❗ IsExist returns true if the given object is exist 72 func IsExist(path string) bool { 73 panic("UNSUPPORTED") 74 return false 75 } 76 77 // ❗ IsRegular returns true if the given object is a regular file 78 func IsRegular(path string) bool { 79 panic("UNSUPPORTED") 80 return false 81 } 82 83 // ❗ IsSocket returns true if the given object is a socket 84 func IsSocket(path string) bool { 85 panic("UNSUPPORTED") 86 return false 87 } 88 89 // ❗ IsBlockDevice returns true if the given object is a device 90 func IsBlockDevice(path string) bool { 91 panic("UNSUPPORTED") 92 return false 93 } 94 95 // ❗ IsCharacterDevice returns true if the given object is a character device 96 func IsCharacterDevice(path string) bool { 97 panic("UNSUPPORTED") 98 return false 99 } 100 101 // ❗ IsDir returns true if the given object is a directory 102 func IsDir(path string) bool { 103 panic("UNSUPPORTED") 104 return false 105 } 106 107 // ❗ IsLink returns true if the given object is a link 108 func IsLink(path string) bool { 109 panic("UNSUPPORTED") 110 return false 111 } 112 113 // ❗ IsReadable returns true if given object is readable by current user 114 func IsReadable(path string) bool { 115 panic("UNSUPPORTED") 116 return false 117 } 118 119 // ❗ IsReadableByUser returns true if given object is readable by some user 120 func IsReadableByUser(path, userName string) bool { 121 panic("UNSUPPORTED") 122 return false 123 } 124 125 // ❗ IsWritable returns true if given object is writable by current user 126 func IsWritable(path string) bool { 127 panic("UNSUPPORTED") 128 return false 129 } 130 131 // ❗ IsWritableByUser returns true if given object is writable by some user 132 func IsWritableByUser(path, userName string) bool { 133 panic("UNSUPPORTED") 134 return false 135 } 136 137 // ❗ IsExecutable returns true if given object is executable by current user 138 func IsExecutable(path string) bool { 139 panic("UNSUPPORTED") 140 return false 141 } 142 143 // ❗ IsExecutableByUser returns true if given object is executable by some user 144 func IsExecutableByUser(path, userName string) bool { 145 panic("UNSUPPORTED") 146 return false 147 } 148 149 // ❗ IsNonEmpty returns true if given file is not empty 150 func IsNonEmpty(path string) bool { 151 panic("UNSUPPORTED") 152 return false 153 } 154 155 // ❗ IsEmptyDir returns true if given directory es empty 156 func IsEmptyDir(path string) bool { 157 panic("UNSUPPORTED") 158 return false 159 } 160 161 // ❗ GetOwner returns object owner UID and GID 162 func GetOwner(path string) (int, int, error) { 163 panic("UNSUPPORTED") 164 return 0, 0, nil 165 } 166 167 // ❗ GetATime returns time of last access 168 func GetATime(path string) (time.Time, error) { 169 panic("UNSUPPORTED") 170 return time.Time{}, nil 171 } 172 173 // ❗ GetCTime returns time of creation 174 func GetCTime(path string) (time.Time, error) { 175 panic("UNSUPPORTED") 176 return time.Time{}, nil 177 } 178 179 // ❗ GetMTime returns time of modification 180 func GetMTime(path string) (time.Time, error) { 181 panic("UNSUPPORTED") 182 return time.Time{}, nil 183 } 184 185 // ❗ GetSize returns file size in bytes 186 func GetSize(path string) int64 { 187 panic("UNSUPPORTED") 188 return -1 189 } 190 191 // ❗ GetMode returns file mode bits 192 func GetMode(path string) os.FileMode { 193 panic("UNSUPPORTED") 194 return 0 195 } 196 197 // ❗ GetTimes returns time of access, modification, and creation at once 198 func GetTimes(path string) (time.Time, time.Time, time.Time, error) { 199 panic("UNSUPPORTED") 200 return time.Time{}, time.Time{}, time.Time{}, nil 201 } 202 203 // ❗ GetTimestamps returns time of access, modification, and creation at once as unix timestamp 204 func GetTimestamps(path string) (int64, int64, int64, error) { 205 panic("UNSUPPORTED") 206 return -1, -1, -1, nil 207 }