checking a file from a certain offset without reading the entire file
NickName:user3021085 Ask DateTime:2013-11-22T17:36:04

checking a file from a certain offset without reading the entire file

what I want to do is open a file(which is huge) and read from a certain point of bytes to an offset.

in c# this can be done with:

File.ReadAllBytes(file).Skip(50).Take(10).ToArray();

the problem with this is that it reads the entire file but since my files can be huges this also takes a long time. is there a way to read parts of a file similiar to this method but WITHOUT reading the entire file? In c preferably

Copyright Notice:Content Author:「user3021085」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/20141462/checking-a-file-from-a-certain-offset-without-reading-the-entire-file

More about “checking a file from a certain offset without reading the entire file” related questions

checking a file from a certain offset without reading the entire file

what I want to do is open a file(which is huge) and read from a certain point of bytes to an offset. in c# this can be done with: File.ReadAllBytes(file).Skip(50).Take(10).ToArray(); the proble...

Show Detail

How to read a file from a certain offset in Java?

Hey I'm trying to open a file and read just from an offset for a certain length! I read this topic: How to read a specific line using the specific line number from a file in Java? in there it said...

Show Detail

How to read a file from a certain offset in Java?

Hey I'm trying to open a file and read just from an offset for a certain length! I read this topic: How to read a specific line using the specific line number from a file in Java? in there it said...

Show Detail

How to read a file from a certain offset in Java?

Hey I'm trying to open a file and read just from an offset for a certain length! I read this topic: How to read a specific line using the specific line number from a file in Java? in there it said...

Show Detail

using python, look at the contents of a compressed file without reading the entire file

Using python, I want to look at the contents of a .zip (deflate) without reading the entire file. I have a very slow network drive containing lots of compressed files. I would like to be able to o...

Show Detail

Mapping data to an offset of a byte buffer allocated for an entire file versus reading the data from the file itself

In a nutshell, I'm just reading BSP files from binary and rendering them. Initially I was doing this through reading each segment individually within the file, and dynamically allocating memory fo...

Show Detail

C# Delete From Beginning of Text File Without Reading Entire File

I have a logging application that works great, but I want to apply the ability to maintain the size of the log file - stop it from getting too large. Ideally, I want to check the size of the file

Show Detail

Reading certain lines from a file in python without loading it in memory

I have a large csv file (90000 rows, 20000 columns). I want to read certain rows from it in Python using an index list. But i don't want to load the entire file using something like "read_csv&...

Show Detail

Read a single worksheet from an XLSX file without reading the entire file?

I am using the NPM 'xlsx' library to process large XLSX files (10-20MB) in Node.js / Javascript. This has slow performance because it reads the entire XLSX file before operating, rather than only r...

Show Detail

Overwrite byte in file without clearing it

How to overwrite a byte in a file without clearing the entire file? Note that I don't want to insert additional bytes but rather overwrite a byte at a certain offset. I have tried the following cod...

Show Detail