fopen (Open file)Correlation function Open,fclose
Table header file #include
Defines the function FILE * fopen (const char * path,const char * mode);
The function description parameter path string contains the file path and filename to open, and
Clearerr (error flag for clearing file streams)FeofHeader file # include Define the void clearerr (File * stream) function );Function Description clearerr () clears the error flag used by the file stream specified by the stream parameter.Return
Clearerr (error flag for clearing file streams)FeofHeader file # include Define the void clearerr (File * stream) function );Function Description clearerr () clears the error flag used by the file stream specified by the stream parameter.Return
Common Linux C functions-File Content operations-general Linux technology-Linux programming and kernel information. For more information, see the following. Clearerr (error flag for clearing file streams)
Feof
Header file # include
Define the
Linux-fopen-fclose-fread-fwrite and other functions
Clearerr (error flag for clearing file streams)
Related functions
Feof
Header file
# Include
Define functions
Void clearerr (File * stream );
Function Description
Clearerr () clears the error
C file operation functionsClearerr (error flag for clearing file streams)FeofHeader file # include Define the void clearerr (File * stream) function );Function Description clearerr () clears the error flag used by the file stream specified by the
fopen (Open file)
Correlation function Open,fclose
Table header file #include
Defines the function FILE * fopen (const char * path,const char * mode);
Function description The path string contains the file path and filename to open, and the
This article illustrates the method of PHP querying IP location. Share to everyone for your reference.
The implementation methods are as follows:
Copy Code code as follows:
/**
*@ Date 2010.12.21
Note: file header [offset of first
Void clearerr (File * stream); The feof function indicates the error flag used by clearerr () to clear the file stream specified by the stream parameter.Int fclose (File * stream ); Related functions close, fflush, fopen, and setbuf indicate that
PHP Query method for IP location
The implementation method is as follows:
The code is as follows:
/**
*@ Date 2010.12.21
Note: file header [offset of first index (4byte)] + [offset address of last index (4byte)] 8 bytes
Record area [end IP (4byte)]
PHP advanced application for PHP file processing allows you to locate and query file pointers, so as to quickly query required information. file pointer functions include rewind (), fseek (), feof () and ftell () functions. In the previous article
Looked at http://hi.baidu.com/qiaoyuetian/item/76c51f0ce25030e4f45ba69e (PHP read a large file in detail), and then tested the inside of the code, found some errors,Summary, the red part marked the change, think or use fseek in the second method
/*--------------------------------------------------
ip2address [Qqwry.dat]
--------------------------------------------------*/
Class IP {
var $fh; IP database file handle
var $first; First Index
var $last; Last index
DAT files, information files about IP-corresponding areasQqwry.dat fileDownload yourself Onlineclass file, parsing the Qqwry.data file'siplocation.php File
Copy Code code as follows:
class Iplocation {
/**
* @var Resource pointer
*/
DAT files, information files about IP-corresponding areas
Qqwry.dat file
Download yourself Online
class file, parsing the Qqwry.data file's
iplocation.php File
Copy Code code as follows:
Class Iplocation {
/**
* @var Resource pointer
Two types of I/O file functions
FopenANSI standard file I/O, based on low-level I/O
OpenLow-level I/O
Ansi I/O Nature
DOS/Windows platform, ms dos file read/write, compilation language
Linux platform, Unix/Linux File read/write, C Language
Php display area code by IP address php display area code by IP
Script ec (2); script
Define ('ipdata _ MINI ', PHPCMS_ROOT. 'include/IPDATA/mini. Dat ');Define ('ipdata _ full', PHPCMS_ROOT. 'include/IPDATA/QQWry. Dat ');
Class ip_area{Var $ fp
DAT files, information about IP-corresponding regions
Qqwry.dat file
Download yourself Online
class file, parsing the Qqwry.data file
iplocation.php File
Copy CodeThe code is as follows:
Class Iplocation {
/**
* @var Resource Hands
*/
Private
DAT files, information about IP-corresponding regions
Qqwry.dat file
Download yourself Online
class file, parsing the Qqwry.data file
iplocation.php File
Copy CodeThe code is as follows:
Class Iplocation {
/**
* @var Resource Hands
*/
Private $fp;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.