TAILIEUCHUNG - Lập trình Linux IO

Các hướng dẫn sau đây mô tả khác nhau phổ biến phương pháp để đọc và ghi các tập tin và thư mục trên một hệ thống Unix. Một phần của thông tin được phổ biến kiến thức C, và được lặp lại ở đây cho đầy đủ | Linux I/O Programming TMA Training Center (TTC) 1. Objective 2. Unix file system 3. Standard I/O Library - Opening file - Closing file - Reading file - Writing file - Seeking file 4. Check user's permissions for a file 5. Get file’s status 6. Change permissions of a file 7. Reading The Contents Of Directories Contents The following tutorial describes various common methods for reading and writing files and directories on a Unix system. Part of the information is common C knowledge, and is repeated here for completeness Objectives Files are stored in the filesystem in two pieces: (1) a chunk of data somewhere in the filesystem; (2) a data structure which contains: location, size, creation/modification/access times, ownership, access attributes of and links to the file. This data structure is called an "inode.“ The only thing about the file not included in the inode is the name of the file Unix File System Unix INODE Structure One of the unique things about Unix as an operating system is that regards everything as a file. Files can be divided into four categories Ordinary or plain files Directories Special or device files. Links Everything is a File Ordinary files Ordinary files can contain text, data, or program information. An ordinary file cannot contain another file, or directory. An ordinary file can be thought of as a one-dimensional array of bytes. Directories In a previous section, we described directories as containers that can hold files, and other directories. A directory is actually implemented as a file that has one line for each item contained within the directory. Each line in a directory file contains only the name of the item, and a numerical reference to the location of the item. The reference is called an i-number, and is an index to a table known as the i-list. The i-list is a complete list of all the storage space available to the file system. Special files Special files represent input/output (i/o) devices, like a tty (terminal), a disk drive, .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.