MCPcopy Index your code
hub / github.com/coder/coder / MkdirAll

Method MkdirAll

agent/agentfiles/files_test.go:80–103  ·  view source on GitHub ↗
(name string, mode os.FileMode)

Source from the content-addressed store, hash-verified

78}
79
80func (fs *testFs) MkdirAll(name string, mode os.FileMode) error {
81 if err := fs.intercept("mkdirall", name); err != nil {
82 return err
83 }
84 // Unlike os, afero lets you create directories where files already exist and
85 // lets you nest them underneath files somehow.
86 stat, err := fs.Fs.Stat(filepath.Dir(name))
87 if err == nil && !stat.IsDir() {
88 return &os.PathError{
89 Op: "mkdir",
90 Path: name,
91 Err: syscall.ENOTDIR,
92 }
93 }
94 stat, err = fs.Fs.Stat(name)
95 if err == nil && !stat.IsDir() {
96 return &os.PathError{
97 Op: "mkdir",
98 Path: name,
99 Err: syscall.ENOTDIR,
100 }
101 }
102 return fs.Fs.MkdirAll(name, mode)
103}
104
105func (fs *testFs) Rename(oldName, newName string) error {
106 if err := fs.intercept("rename", newName); err != nil {

Callers 15

cfgPathFunction · 0.80
TestCompressorEncodingsFunction · 0.80
TestCompressorHeadingsFunction · 0.80
compressMethod · 0.80
UntarFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected