MCPcopy
hub / github.com/docker/compose / WriteFile

Method WriteFile

pkg/watch/temp_dir_fixture.go:103–115  ·  pkg/watch/temp_dir_fixture.go::TempDirFixture.WriteFile

Returns the full path to the file written.

(path string, contents string)

Source from the content-addressed store, hash-verified

101
102// Returns the full path to the file written.
103func (f *TempDirFixture) WriteFile(path string, contents string) string {
104 fullPath := f.JoinPath(path)
105 base := filepath.Dir(fullPath)
106 err := os.MkdirAll(base, os.FileMode(0o777))
107 if err != nil {
108 f.t.Fatal(err)
109 }
110 err = os.WriteFile(fullPath, []byte(contents), os.FileMode(0o777))
111 if err != nil {
112 f.t.Fatal(err)
113 }
114 return fullPath
115}
116
117// Returns the full path to the file written.
118func (f *TempDirFixture) CopyFile(originalPath, newPath string) {

Callers 15

CopyFileMethod · 0.95
TouchFilesMethod · 0.95
convertFunction · 0.80
CreateTransformerFunction · 0.80
TestDontWatchEachFileFunction · 0.80
TestEventOrderingFunction · 0.80
TestGitBranchSwitchFunction · 0.80
TestWatchesAreRecursiveFunction · 0.80
TestWatchNonExistentPathFunction · 0.80
TestRemoveFunction · 0.80

Calls 3

JoinPathMethod · 0.95
MkdirAllMethod · 0.80
DirMethod · 0.45

Tested by 15

TestDontWatchEachFileFunction · 0.64
TestEventOrderingFunction · 0.64
TestGitBranchSwitchFunction · 0.64
TestWatchesAreRecursiveFunction · 0.64
TestWatchNonExistentPathFunction · 0.64
TestRemoveFunction · 0.64
TestRemoveAndAddBackFunction · 0.64
TestSingleFileFunction · 0.64
TestWriteGoodLinkFunction · 0.64
TestMoveAndReplaceFunction · 0.64