I'm using the google cloud functions, I need to delete and rename files but using the os
module and any module which is similar to it, will cause problems on Google cloud platform. I don't have the exact error message now, but I now that from a previous experience.
I'm thinking to rewrite the file, because reading/writing files is working. Is there any better option that can be safely used in Google cloud functions?
So basically if you do upload a text file to the google cloud function and then do os.rename("foo.txtr,bar.txt")
, you get an error like this one.
CodePudding user response:
Try this instruction instead:
shutil.move()