It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
In which place C saves file's offset?
When using standard C I/O, a FILE pointer contains most of the information needed to deal with the file, including its "position indicator." As you read or write through the file, its position (seek) indicator gets updated. See the definition of the FILE type.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have simple question.. when I used read method in pipes, what argument return? Example:
temp = read(fb[0],readbuffer,sizeof(readbuffer));
what will return to temp?
The number of bytes read from the pipe
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I want to lock a file while writing no one should be able to read it. how to do it?.. please provide sample code.
Do you use fopen? Then
fopen
x -
Open the file exclusively (like the O_EXCL flag of open(2)). If the file already exists, fopen() fails, and sets errno to EEXIST. This flag is ignored for fdopen().
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Just the question! Why can it not sort more than 254859 elements?
It can, but:
It takes forever
You need to use data types that can hold enough elements.
Other than that, there is absolutely no reason why the algorithm itself would be limited to any particular input size.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I want to create a file in C with a given file size. Is it possible?
Create the file.
Write bytes to it, until you've written the size you want.
Close file.
The loop should be all of about 2 lines of code.
What difficulties are you encountering?
create the file
seek to the desired size
write 0 bytes
close the file.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I want to read an image(JPEG) file from hard disk to memory. How can I do this? What kind of variable type should I use ?
Use a big char array
char data[4096]
And fread(3) chunks into it. Of course an entire JPEG won't fit in 4096 bytes, but perhaps you can work with chunks instead of the entire file ?