Re: Remove/change fs_truncate() API
Andrzej Kaczmarek
Hi David, On Mon, Sep 4, 2017 at 5:17 PM, David Brown <david.brown@...> wrote: On Mon, Sep 04, 2017 at 09:27:30AM +0200, Andrzej Kaczmarek wrote: I'm not really sure if this needs to be POSIX compliant - the Jira ticket for adding filesystem APIs states that it is designed after POSIX but is not POSIX compliant. For example, fs_open() does not have flags which could be used to truncate existing file when opening, so it would cover one of possible scenarios here. But perhaps something changed since then, don't know. So do we really need option to truncate any opened file to any size? Yes, currently I return ENOTSUP for this. My only concern here is that this means there is no way to open existing file and truncate it other than fs_unlink() + fs_open() due to missing flags in fs_open() I mentioned above. BTW, does it make sense to have fs_truncate() work for '0' as offset and return e.g. EINVAL for other values? This should be doable I think. David Best regards, Andrzej
|
|