THANK YOU VERY MUCH.
M
Cameron Simpson <[EMAIL PROTECTED]> wrote:
On 27Sep2007 13:22, usman muktar <[EMAIL PROTECTED]> wrote:
| Thank you, i am sorry that my question was not clear. What i intend
| to ask was how to write the entire command from scratch.
Please do not top post. Reply _below_ the quoted material, and trim it.
Possibly you mean "if I have no tail command, how to write one in C?"
- Parse "n" from the command line arguments in the argv[] array.
- Seek to the end of the file. Read the last chunk.
- Count the newline characters until you find the "n+1"th one. That is the
end of the "n+1"th last line.
- If there are not enough newlines in the chunk, read another chunk from
earlier in the file and keep counting. Repeat until you find the "n=1"th
newline or hit the start of the file.
- Copy data from just after that newline until the end of the file.
Cheers,
--
Cameron Simpson <[EMAIL PROTECTED]> DoD#743
http://www.cskk.ezoshosting.com/cs/
you just don't get it, do you?
here, i'll make it REALLY simple for you:
if you suffer a lapse of judgement, even a very fleeting one, on a bike
in traffic, you stand a good chance of DYING a horrible, body-mangling,
bone-crushing DEATH.
if you do the same thing in a cage, you stand a good chance of denting
a fender.
NOW DO YOU GET IT?
- ye wilde ryder <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
---------------------------------
Moody friends. Drama queens. Your life? Nope! - their life, your story.
Play Sims Stories at Yahoo! Games.
[Non-text portions of this message have been removed]
To unsubscribe from this list, please email [EMAIL PROTECTED] & you will be
removed.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/LINUX_Newbies/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/LINUX_Newbies/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/