I opened one file as follows:
fp = fopen("some.txt","r");
Now in this file the first few bytes allow us to say that 40 bytes is an unnecessary data garbage, so I want to delete them. But I canโt delete this data from this file, change or duplicate this file without extra data.
So, I want to create another dummy FILE pointer that points to a file, and when I pass this dummy pointer to any other function that performs the following operation:
fseek ( dummy file pointer , 0 , SEEK_SET );
then it should set the file pointer to the 40th position in my some.txt.
But the function accepts a file descriptor, so I need to pass a file descriptor that will process the file, since the first 40 bytes were never in the file.
In short, this dummy descriptor must process the file, since these 40 bytes were not in this file, and all positioning operations should refer to this 40th byte count as 1st byte.
source share