Re: [ecasound] What is the purpose of AUDIO_IO_DEVICE::io_mode == io_readwrite?
Brought to you by:
kaiv
From: Lorenz M. <lm...@gm...> - 2011-08-05 06:54:14
|
Hi Kai, Thanks for your explanations, they are very much appreciated! The message I take home from this is that is that devices (unlike file backends) ought to not implement io_readwrite, since there is no proper analogy. As a note aside, "r+" (with creation of a new file if no such already exists) would be the better analogy below, since "w+" discards the contents of the previous file, which apppears not to be what is intended here. Best, --Lorenz Kai Vehmanen wrote: > >I have a question regarding the io_mode for an audio device: What is > >the purpose of the io_readwrite mode? I was assuming that devices > > it's analogous to "w+" mode of fopen. Quoting fopen man page: > ""w+: Open for reading and writing. The file is created if it does > not exist, otherwise it is truncated. The stream is positioned at > the beginning'of the file."" > > Simiarly io_write is similar to "w" mode, i.e. the output is always > truncated. > > >So what is the purpose if io_readwrite in that context, and how is a > >device supposed to handle that? > > The main use case for io_readwrite is the ability to open file > outputs in update mode (e.g. to replace only portions of a > recording, or continue recording at the end of an existing file). |