hdfs icon indicating copy to clipboard operation
hdfs copied to clipboard

Create file with truncate

Open flashpixx opened this issue 5 years ago • 1 comments

On calling CreateFile on existing files I get an error, so the CreateFile call should be like the Golang CreateFile:

func Create(name string) (*File, error) {
	return OpenFile(name, O_RDWR|O_CREATE|O_TRUNC, 0666)
}

So an existing file will be overwritten

flashpixx avatar Mar 11 '20 21:03 flashpixx

Hi @flashpixx,

I think you're right that that should be the behaviour for Create (if not CreateFile). However, I think that's enough of a behaviour change that it should be put off until a major version bump. I'll leave this issue open for now.

colinmarc avatar Jun 05 '20 09:06 colinmarc