Web hosting servers - 3Working with FilesIn this chapter, we ll be looking
3Working with FilesIn this chapter, we ll be looking at Linux files and directories and how to manipulate them. We lllearn how to create files, open them, read, write, and close them. We ll also learn how programscan manipulate directories (to create, scan, and delete them, for example). After the last chapter sdiversion into shells, we now start programming in C. Before proceeding to the way Linux handles file I/O, we ll review the concepts associated withfiles, directories, and devices. To manipulate files and directories, we need to make system calls(the UNIX and Linux parallel of the Windows API), but there also exists a whole range of libraryfunctions, the standard I/O library (stdio), to make file handling more efficient. We ll spend the majority of the chapter detailing the various calls to handle files and directories. So this chapter will cover .Files and devices .System calls .Library functions .Low-level file access .Managing files .The standard I/O library .Formatted input and output .File and directory maintenance .Scanning directories .Errors .The /procfile system .Advanced topics: fcntland mmapb544977