LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Reading contents of a specific block of a file (https://www.linuxquestions.org/questions/linux-newbie-8/reading-contents-of-a-specific-block-of-a-file-4175466854/)

Bhupendra Singh 06-21-2013 05:21 AM

Reading contents of a specific block of a file
 
Hello greetings of the day!!!

Sir, I want to read the contents of a block(cluster) of a file.Suppose my file name is test.txt (size=9200 bytes) and is allocated to 3 blocks(say 23,24,25). Now i want to read the contents of block 25 and want to know what is wriiten in the unused sectors of last block(25)?Suppose i want to hide data in the unused sectors(slack space) of the last block then how i can do this?

Please give me such program or command that can do this on linux.

thank you in advance.

tronayne 06-21-2013 08:00 AM

Take a look at the fseek() manual page (and look for some examples of using it with Google).

Hope this helps some.

jpollard 06-21-2013 08:56 PM

Umm... files don't get "unused sectors". They are all defined - even the files with "holes" in the allocation (they are all zero bytes).

The last "block" may not be complete - files only have the bytes that are allocated - you can't read past the end of file.


All times are GMT -5. The time now is 05:59 AM.