Replies: 1 comment
-
Here's how I've been using it: interface ContainerPathStat {
name: string
size: number
mode: number
mtime: string
linkTarget: string
}
container.infoArchive({path: 'mypath'}, (err, data) => {
if (err) {
this.logger.error(`Error getting file from container: ${err}`)
}
if (data as IncomingMessage) {
// data is an `IncomingMessage` object
const containerPathStat = JSON.parse(Buffer.from(data.headers['x-docker-container-path-stat'], 'base64').toString()) as ContainerPathStat
this.logger.info(`file size: ${containerPathStat.size}`)
}
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. I am trying to list the files inside a container. I tried doing it like so:
But it returns an
IncomingMessage
object, how does this function work?Thanks.
Beta Was this translation helpful? Give feedback.
All reactions