fsspec / gcsfs

Pythonic file-system interface for Google Cloud Storage
http://gcsfs.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
346 stars 146 forks source link

Is there an async version of touch? #634

Open vedantroy opened 4 months ago

vedantroy commented 4 months ago

Exactly as the question sounds. Is there an async version of touch?

martindurant commented 4 months ago

To create an empty file, you can do

await fs._pipe_file(path, b"")

I don't think any async backends support the extended use of touch to update the timestamp or truncate to a specific length; but you can probably update metadata separately (also backend-specific).