Originally intended to read the socket and other related content, but the writing is really good, or decided to read the rest of the content.
An example of reading online Help:
Open System Call:
Read system call:
Time for Unix:
printf above can be seen, a temporary char* pointer can also be +4, want to see if there is malloc in the CTime function, if any, who will release the memory??? If not, why can the pointer operate.
To solve the above doubts, by looking at http://www.cplusplus.com/reference/ctime/ctime/and http://www.cplusplus.com/reference/ctime/asctime/, get:
CTimeChar* CTime (Consttime_t *timer); Convert time_t value tostringThis function isequivalent To:asctime (localtime (timer))asctime Char* Asctime (Const structTM *timeptr); CONVERT TM Structure tostringIt isdefined with a behavior equivalent to:Char* Asctime (Const structTM *timeptr) { Static Const Charwday_name[][4] = { "Sun","Mon","Tue","Wed","Thu","Fri","Sat" }; Static Const Charmon_name[][4] = { "Jan","Feb","Mar","APR"," May","June", "Jul"," the","Sep","Oct","Nov","Dec" }; Static char result[ ]; sprintf (Result,"%.3s%.3s%3d%.2d:%.2d:%.2d%d\n", Wday_name[timeptr-Tm_wday], mon_name[timeptr-Tm_mon], timeptr->tm_mday, timeptr->Tm_hour, Timeptr->tm_min, timeptr->Tm_sec,1900+ timeptr->tm_year); return result;}
The doubt is lifted, and you can see that CTime returns a static local char array.
System call Lseek Change Open file location:
Handling Errors in system calls
Determine the type of error errno.
Display error message Perror:
The ls-a option lists hidden files:
How to write LS:
Stat gets file attribute information:
Where the structure of stat is:
Convert a pattern field to a character
To get the file type using a mask:
Unix/linux Programming Practice Tutorial (0:)