This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: fatfs lseek EOF bug
Gratian Crisan wrote:
The patch works OK :), thanks.
Ok, I'll wait a couple of days and then send the patch to ecos-patches.
On a side note: I'm looking for an alternative implementation for 'ftruncate'
POSIX function which is missing from eCos. Do you know how I could implement
it for fatfs?
It should not be too hard - If the file is shrinking find the last
cluster of the new file length
(get_position_from_off), free all clusters from the current one the the
end of the file
(free_cluster_chain) and change the size of the coresponding fatfs node.
If the file is extending,
then you need to allocate the appropriate number of clusters and link
them into the file cluster chain
(find_and_append_cluster).
savin
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss