MCPcopy
hub / github.com/syncthing/syncthing / CreateRoot

Method CreateRoot

lib/config/folderconfiguration.go:248–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

246}
247
248func (f *FolderConfiguration) CreateRoot() (err error) {
249 // Directory permission bits. Will be filtered down to something
250 // sane by umask on Unixes.
251 permBits := fs.FileMode(0o777)
252 if build.IsWindows {
253 // Windows has no umask so we must chose a safer set of bits to
254 // begin with.
255 permBits = 0o700
256 }
257
258 filesystem := f.Filesystem()
259
260 if _, err = filesystem.Stat("."); fs.IsNotExist(err) {
261 err = filesystem.MkdirAll(".", permBits)
262 }
263
264 return err
265}
266
267func (f FolderConfiguration) Description() string {
268 if f.Label == "" {

Callers 3

initFoldersMethod · 0.80
setIgnoresMethod · 0.80

Calls 5

FilesystemMethod · 0.95
FileModeTypeAlias · 0.92
IsNotExistFunction · 0.92
StatMethod · 0.65
MkdirAllMethod · 0.65

Tested by

no test coverage detected