#how do i check the presence of a file in a container
1 messages Β· Page 1 of 1 (latest)
π File("/tmp/foo").Size(ctx) This returns an error if the file doesn't exit
also keep an eye on this: https://github.com/dagger/dagger/issues/6713
i am trying to see if the file exist as per your suggestion using size and Sync . both of these result in the pipeline failing if the file does not exist which was not my expectation
i want to continue exeting if the actual file is missing. is that possible ?
β connect 0.4s
β initialize 3.3s
β prepare 0.0s
β tester: Tester! 0.0s
β Tester.buildTools: Container! 0.7s
! call function "BuildTools": process "/runtime" did not complete successfully: exit code: 2
β file exist false
β file exist false
β marshal: json: error calling MarshalJSON for type *dagger.Container: input: container.from.withMountedCache.withEnvVariable.withExec.directory resolve: /t3dp/app/latest: cannot retrieve path from cache
β Container.from(address: "alpine:latest"): Container! 0.2s
β Container.file(path: "/t3dp/app/latest"): File! 0.0s
! /t3dp/app/latest: cannot retrieve path from cache
β Container.file(path: "/t3dp/app/latest"): File! 0.0s
! /t3dp/app/latest: cannot retrieve path from cache
β Container.directory(path: "/t3dp/app/latest"): Directory! 0.0s
! /t3dp/app/latest: cannot retrieve path from cache
here is the error
starting to get it .... i cant do that on a mounted volume .. <facepalm/>