Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read as need, how to read first 256 bytes from online large file without downloading?

I need to read just first 256 B from large file, from mapped WebDAV drive.

I open file with

h_second = CreateFileA(second_server, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);

but it first downloads whole file, and after that can I read it. And I want something, that downloads just a small part of file and I read that.

Can anyone help me?

like image 778
FrUh Avatar asked Aug 16 '12 10:08

FrUh


People also ask

How do I read data from a text file?

To read from a text fileUse the ReadAllText method of the My. Computer. FileSystem object to read the contents of a text file into a string, supplying the path. The following example reads the contents of test.

How do I read a 100 GB file in Python?

Reading Large Text Files in Python We can use the file object as an iterator. The iterator will return each line one by one, which can be processed. This will not read the whole file into memory and it's suitable to read large files in Python.

What is the fastest way to read a large file in Python?

To read large text files in Python, we can use the file object as an iterator to iterate over the file and perform the required task. Since the iterator just iterates over the entire file and does not require any additional data structure for data storage, the memory consumed is less comparatively.


1 Answers

WebDAV is an extension to HTTP, and HTTP already has a range request.

like image 116
MSalters Avatar answered Sep 29 '22 12:09

MSalters