That is pretty cool. fopen is troublesome over the network though. Correct me if I am wrong, but writing to gs:// means that the writes are replicated to something like 3 physical disks in different data centers, which means it is probably 100x slower than writing to a local disk (but infinitely more durable).
gs:// seems like a great option for file uploads, but it could be a problem with thing like asset pipelines where stat can get called absurdly often. Any thoughts?
It's certainly slower, and more durable, than local disk for writes. For reads/stat()ing this is mitigated to a certain extent by optimistic caching in memcache.
You also get the advantage, for asset pipelines, in that GCS can serve the generated file directly.
$fp = fopen("gs://my_bucket/some_file.txt", "w"); fwrite($fp, "Hello"); fclose($fp);