Error happens while applying "chmod" to tmp file

  • OS: Centos7
  • Language: Python
  • Related Code: os.system('chmod g+w %s' % path)
  • Description:

    1. I want to run this command after creating a file
    2. But when I edit and save the existing file, the OS will create the .tmp file like ~gvfSFkS.tmp and then move,this is rename,the tmp file to override the file that was edited.
    3. Here is the INFO the shell giving
      `chmod: cannot access ‘/home/share/private/student/aa/~gvfSFkS.tmp’: No such file or directory
  • What I want to know

    1. The season why it happens?
    2. How I can apply chmod commad to such kind files.
  • Others
    I want this python script as root.
阅读 1.8k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进