Hardware Reference
In-Depth Information
fclose
This function from the C library is available within Galileo to close an opened
file in the Linux file system. See “Another Approach to Passing Data” on page
117 for more information.
Syntax
fclose(fp);
Parameters
fp
A pointer to a file.
Return value
If successfully closed, 1. Otherwise, an error occurred.
Example
int getHours() {
char output[5];
system("curl http://nextmakemagazine.appspot.com/simple > response.txt");
FILE *fp;
fp = fopen("response.txt", "r");
fgets(output, 5, fp);
fclose(fp);
return atoi(output);
}
fgets
This function from the C library is available within Galileo to read the contents
of an opened file in the Linux file system. See “Another Approach to Passing
Data” on page 117 for more information.
Syntax
fgets(output, bytes, fp);
Parameters
output
An array to store the read bytes
bytes
The number of bytes to read
fp
A pointer to a file
Return value
Search WWH ::




Custom Search