tpie icon indicating copy to clipboard operation
tpie copied to clipboard

Change file_stream::open() to accepting a bit mask of flags

Open Mortal opened this issue 10 years ago • 2 comments

Currently, file_stream::open accepts three enumeration valued parameters: read/write, sequential/random access, compressed/uncompressed.

We should probably switch to a typesafe bitmask to save us from a horrible mess in the future.

I have pushed branch open_flags which implements this.

Comments?

Mortal avatar Apr 24 '14 15:04 Mortal

I think the default flag value should be zero. The Linux syscall open(2) has O_RDONLY = 0, O_WRONLY = 1 and O_RDWR = 2, and other flags only for non-default behaviors.

Thus I think read_write, access_sequential and compression_none should correspond to zeros in the file_stream.open API, and I'm considering if we should just drop the identifiers altogether -- instead specifying that read/write, optimizing for sequential access and no compression are the defaults, and the user should specify otherwise to get a different behavior.

Mortal avatar Apr 25 '14 11:04 Mortal

Seems to have been closed in 71567f02f9f3adc194ac0d1c17b78d2584f2dc65 .

SSoelvsten avatar Jul 27 '22 09:07 SSoelvsten