Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, maybe I'm stupid, but i was trying to find on the Google how to do a backspace. In C-program I want to load some TXT-file and delete f.e. last ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2012
    Posts
    2

    Lightbulb Backspace


    Hi,

    maybe I'm stupid, but i was trying to find on the Google how to do a backspace. In C-program I want to load some TXT-file and delete f.e. last 20chars. I tried \b but it didn't work.

    Can anyone help me?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,663
    You might start by showing your code so we know how you are trying to accomplish your goals. In any case, the simple (possibly not correct in your case) answer is to move your pointer to the end of the string minus 20 characters, and then insert a NUL ('\0') byte.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Sep 2012
    Posts
    2
    Iam sorry... I was ucky guy.. My was talking with my friend and he told me try to fseek.. I did this, but I wrote this code fseek ( target , 18 , SEEK_END ); instead of this fseek ( target , 18 , SEEK_END );

    So thank you for your time

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •