Thread: Read part of file

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    7

    Read part of file

    Problem is read first n-th part of text file. Is there any function to get character count of file or somethink similar? If the file have 48 characters and I want only first half part of the file the result will be 24, whether I want first third part of text file the result will be 16 and so on.
    Please is there some function for this or how to create this function. Thank's.

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,794
    fopen as binary
    fseek to the end
    ftell
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  3. c script help to read a file & update
    By indy in forum C Programming
    Replies: 8
    Last Post: 12-01-2003, 11:32 AM
  4. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM