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

Function CallDirStat

core/modulesource.go:2000–2019  ·  view source on GitHub ↗
(ctx context.Context, dir dagql.ObjectResult[*Directory], path string)

Source from the content-addressed store, hash-verified

1998}
1999
2000func CallDirStat(ctx context.Context, dir dagql.ObjectResult[*Directory], path string) (string, *Stat, error) {
2001 dag, err := CurrentDagqlServer(ctx)
2002 if err != nil {
2003 return "", nil, err
2004 }
2005
2006 var info *Stat
2007 err = dag.Select(ctx, dir, &info,
2008 dagql.Selector{
2009 Field: "stat",
2010 Args: []dagql.NamedInput{
2011 {Name: "path", Value: dagql.String(path)},
2012 },
2013 },
2014 )
2015 if err != nil {
2016 return "", nil, err
2017 }
2018 return filepath.Dir(path), info, nil
2019}
2020
2021// DirectoryStatFS implements StatFS over a dagql Directory.
2022type DirectoryStatFS struct {

Callers 2

StatMethod · 0.85
StatMethod · 0.85

Calls 4

StringTypeAlias · 0.92
CurrentDagqlServerFunction · 0.70
SelectMethod · 0.65
DirMethod · 0.45

Tested by

no test coverage detected