【问题标题】:How to create folder to the network computer using os.mkdir() python command on apache?如何在 apache 上使用 os.mkdir() python 命令创建文件夹到网络计算机?
【发布时间】:2011-08-07 06:38:31
【问题描述】:

我正在使用 Win2008 服务器 + Apache2.2 + mod_python。 我会使用 Web 表单中的字符串值创建一个文件夹。 它适用于本地驱动器

os.mkdir('D:\\temp\\" + folederName)`

但它在网络上不起作用 -

os.mkdir('\\\\192.168.131.200\\temp\\" + folederName) 

如何在网络计算机上创建文件夹?

【问题讨论】:

    标签: python apache mod-python mkdir


    【解决方案1】:

    疯狂猜测:

    将共享挂载到 Driveletter,以便您可以通过 Z:\xyz.txt 访问它

    因为\\\host\path 并不是真正可以在普通文件系统操作中处理的内容。

    编辑:请使用os.path.join() 而不是硬编码路径内容:)

    【讨论】:

      猜你喜欢
      • 2012-09-13
      • 1970-01-01
      • 1970-01-01
      • 2013-11-23
      • 1970-01-01
      • 2012-01-12
      • 2016-11-24
      • 1970-01-01
      • 2015-07-05
      相关资源
      最近更新 更多