Python/AWS Lambda函数:如何查看/tmp存储? [英] Python/AWS Lambda Function: How to view /tmp storage?

查看:263
本文介绍了Python/AWS Lambda函数:如何查看/tmp存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Lambda函数可以访问其自己的/tmp目录中的磁盘空间.我的问题是,在哪里可以直观地查看/tmp目录?

Lambda functions have access to disk space in their own /tmp directories. My question is, where can I visually view the /tmp directory?

我正尝试将文件下载到/tmp目录中以进行读取,并向其中写入新文件.我实际上希望看到正在使用的文件在执行期间正确存储在/tmp中.

I’m attempting to download the files into the /tmp directory to read them, and write a new file to it as well. I actually want see the files I’m working with are getting stored properly in /tmp during execution.

谢谢

推荐答案

lambda执行结束后,您将无法查看"/tmp目录.

You can't 'view' the /tmp directory after the lambda execution has ended.

Lambda在分布式体系结构中工作,执行后,所有使用的资源(包括存储在/tmp中的所有文件)都将被处置.

Lambda works in distributed architecture and after the execution all resources used (including all files stored in /tmp) are disposed.

因此,如果您要检查文件,则可能需要考虑使用EC2或S3.

So if you want to check your files, you might want consider using EC2 or S3.

如果只想检查s3下载是否成功,则可以在执行过程中尝试:

If you just want to check if the s3 download was successful, during the execution, you can try:

import os
os.path.isfile('/tmp/' + filename)

这篇关于Python/AWS Lambda函数:如何查看/tmp存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆