MCPcopy Index your code
hub / github.com/dagger/dagger / StatFSExists

Function StatFSExists

core/modulesource.go:1915–1929  ·  view source on GitHub ↗
(ctx context.Context, statFS StatFS, path string)

Source from the content-addressed store, hash-verified

1913}
1914
1915func StatFSExists(ctx context.Context, statFS StatFS, path string) (string, bool, error) {
1916 if existsFS, ok := statFS.(ExistsFS); ok {
1917 return existsFS.Exists(ctx, path)
1918 }
1919
1920 dirName, _, err := statFS.Stat(ctx, path)
1921 switch {
1922 case err == nil:
1923 return dirName, true, nil
1924 case errors.Is(err, os.ErrNotExist):
1925 return "", false, nil
1926 default:
1927 return "", false, err
1928 }
1929}
1930
1931type CallerStatFS struct {
1932 bk *engineutil.Client

Callers 4

findUpMethod · 0.92
gitModuleSourceMethod · 0.92
FindUpAllMethod · 0.85

Calls 3

IsMethod · 0.80
ExistsMethod · 0.65
StatMethod · 0.65

Tested by

no test coverage detected