Truncate beginning of a file

Discussion in 'Python' started by s0suk3@gmail.com, May 5, 2008.

  1. Guest

    file.truncate(X) will truncate the file to at most X bytes (i.e. leave
    the first X bytes of the file and throw away the rest). Is there a way
    to throw away, say, the first X bytes of the file, and leave the rest?
    (Without opening the same file for reading, reading and processing,
    overwriting the file with the new processed data, etc.)
     
    , May 5, 2008
    #1
    1. Advertising

  2. On Sun, 04 May 2008 22:06:42 -0700, s0suk3 wrote:

    > file.truncate(X) will truncate the file to at most X bytes (i.e. leave
    > the first X bytes of the file and throw away the rest). Is there a way
    > to throw away, say, the first X bytes of the file, and leave the rest?
    > (Without opening the same file for reading, reading and processing,
    > overwriting the file with the new processed data, etc.)


    No.

    Ciao,
    Marc 'BlackJack' Rintsch
     
    Marc 'BlackJack' Rintsch, May 5, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hongyu
    Replies:
    9
    Views:
    973
    James Kanze
    Aug 8, 2008
  2. Chuck Remes
    Replies:
    7
    Views:
    235
    Gary Wright
    Feb 9, 2010
  3. Jesse B.
    Replies:
    9
    Views:
    261
    Jesse B.
    Mar 27, 2010
  4. Leslie Viljoen

    File#truncate fills file with zeros

    Leslie Viljoen, Nov 16, 2010, in forum: Ruby
    Replies:
    1
    Views:
    151
    Leslie Viljoen
    Nov 16, 2010
  5. BG
    Replies:
    2
    Views:
    133
Loading...

Share This Page