fsspec / fsspec/filesystem_spec

Change to truncate=False in touch()?

Open
#583 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
490
Avg merge
2d 3h
Merged PRs (30d)
38

Description

Ref: https://github.com/dask/gcsfs/issues/364

Currently, fs.tuncate() will remove a pre-existing file and make a zero-size one, unless the caller explicitly says truncate=False. This proposal is to change the default.

Why yes:

  • would be the safe option
  • fits the normal posix understanding

Why no:

  • many filesystems do not implement "update timestamp", so would get NotImplemented errors
  • the most common usage is probably truncate=True (but this may be because of the default already)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the filesystem touch() implementation and reviewing the referenced gcsfs issue. Check how filesystem implementations handle timestamp updates and the truncate argument. Done means the default behavior is decided and consistently supported without unexpected NotImplemented errors, with the relevant behavior verified across affected filesystems.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.