How to read a file using seek

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nishant Gaurav
    New Member
    • Jul 2010
    • 17

    How to read a file using seek

    Hi All,

    I have 10 log files whose size is not fixed as they are being updated. I want to read these files and store it in 1 file.
    the twist is i want to read say first 1024 bytes from each file and then after reading from all the files i want to read from the position till where i have read in the first file the next 1024 bytes and so on.

    Please Let me know how this can be achieved.

    Thanks & Regards
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Open 10 FileStreams. Use .Read on them. You don't have to Seek, the FileStreams remember their place. Just use 1024 for the count.

    But make sure to check if the FileStream is at the end of the file first.

    Comment

    Working...