【问题标题】:google app engine cron gives file permissione issues谷歌应用引擎 cron 给出文件权限问题
【发布时间】:2016-10-20 16:01:21
【问题描述】:

我已经在谷歌应用引擎中启动了一个 cron,并将一些内容写入文件 test.txt,但是当我在我的开发服务器中的 http://localhost:8000/cron 中运行 cron 时,这个输出给了我 500 错误。

 File "/base/data/home/apps/s~stock-analysis-1344/1.393612282659426384/hello.py", line 8, in get 
 f = open("test.txt","w") #opens file with name of "test.txt"
 IOError: [Errno 30] Read-only file system: 'test.txt'

【问题讨论】:

    标签: python-2.7 google-app-engine cron file-permissions


    【解决方案1】:

    The standard GAE sandbox 不授予对文件系统的写访问权限:

    App Engine 应用程序不能:

    • 写入文件系统。应用程序必须使用the App Engine datastore 来存储持久数据。从文件系统读取 是允许的,并且所有与应用程序一起上传的应用程序文件 可用。

    但是,该应用可以写入 Google Cloud Storage 存储分区中的文件。请参阅Reading and Writing to Google Cloud Storage 和/或App Engine and Google Cloud Storage Sample

    【讨论】:

      猜你喜欢
      • 2014-03-22
      • 2011-08-21
      • 2013-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-22
      • 1970-01-01
      相关资源
      最近更新 更多