title: Create csv file in Cloud Storage using Cloud Functions
body: <p>I have been trying to create a csv file from a string in Cloud Functions. It is storing the file temporarily in /tmp folder. Then the file goes to the bucket.</p>
  
  <p>Following is my code - </p>
  
  <pre><code>def upload_blob(bucket_name, source_file_name, destination_blob_name):
  
      storage_client = storage.Client()
      bucket = storage_client.get_bucket(bucket_name)
      blob = bucket.blob(destination_blob_name)
      blob.upload_from_file(source_file_name)
  
  message = "Data for CSV file"
  csv = open('test.csv', "w")    #ERROR HERE
  csv.write(message)
  with open('/tmp/test.csv', 'r') as file_obj:
      upload_blob('test-bucket', file_obj, 'test.csv')
  </code></pre>
  
  <p>I am getting the following error - </p>
  
  <pre><code>File "/user_code/main.py", line 30, in hello_main csv = open('test.csv', 
  "w") OSError: [Errno 30] Read-only file system: 'test.csv'
  </code></pre>
  
  <p>How to make this file writable?</p>