MCPcopy
hub / github.com/rclone/rclone / SetConfigPath

Function SetConfigPath

fs/config/config.go:326–339  ·  view source on GitHub ↗

SetConfigPath sets new config file path Checks for empty string, os null device, or special path, all of which indicates in-memory config.

(path string)

Source from the content-addressed store, hash-verified

324//
325// Checks for empty string, os null device, or special path, all of which indicates in-memory config.
326func SetConfigPath(path string) (err error) {
327 var cfgPath string
328 if path == "" || path == os.DevNull {
329 cfgPath = ""
330 } else if filepath.Base(path) == noConfigFile {
331 cfgPath = ""
332 } else if err = file.IsReserved(path); err != nil {
333 return err
334 } else if cfgPath, err = filepath.Abs(path); err != nil {
335 return err
336 }
337 configPath = cfgPath
338 return nil
339}
340
341// SetData sets new config file storage
342func SetData(newData Storage) {

Callers 15

InitialiseFunction · 0.92
TestConfigLoadFunction · 0.92
TestConfigLoadEncryptedFunction · 0.92
testConfigFileFunction · 0.92
TestRcFunction · 0.92
setConfigFileFunction · 0.92
testConfigFileNoConfigFunction · 0.92
TestConfigFileNoConfigFunction · 0.92

Calls 2

IsReservedFunction · 0.92
BaseMethod · 0.80

Tested by 14

TestConfigLoadFunction · 0.74
TestConfigLoadEncryptedFunction · 0.74
testConfigFileFunction · 0.74
TestRcFunction · 0.74
setConfigFileFunction · 0.74
testConfigFileNoConfigFunction · 0.74
TestConfigFileNoConfigFunction · 0.74
TestConfigFileSaveFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…