public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Savin Zlobec <savin@elatec.si>
To: Gratian Crisan <nelu@iv.ro>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] fatfs lseek EOF bug
Date: Wed, 11 May 2005 09:32:00 -0000	[thread overview]
Message-ID: <4281B63F.1060107@elatec.si> (raw)
In-Reply-To: <200505101500.19717.nelu@iv.ro>

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

      reply	other threads:[~2005-05-11  7:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-09 11:25 Gratian Crisan
2005-05-10 10:51 ` Savin Zlobec
2005-05-10 12:05   ` Gratian Crisan
2005-05-10 12:30     ` Savin Zlobec
2005-05-10 13:00       ` Gratian Crisan
2005-05-11  9:32         ` Savin Zlobec [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4281B63F.1060107@elatec.si \
    --to=savin@elatec.si \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=nelu@iv.ro \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).