From 219d6a2f98c8707f111e9e3b216ae1626054f7a1 Mon Sep 17 00:00:00 2001 From: Jet Hughes Date: Fri, 4 Nov 2022 12:01:13 +1300 Subject: [PATCH] vault backup: 2022-11-04 12:01:13 --- content/notes/15-file-systems.md | 3 +-- content/notes/204-questions.md | 9 +++++++++ content/notes/management-of-file-systems.md | 16 +++++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 content/notes/204-questions.md diff --git a/content/notes/15-file-systems.md b/content/notes/15-file-systems.md index 23b095891..321a61b5b 100644 --- a/content/notes/15-file-systems.md +++ b/content/notes/15-file-systems.md @@ -60,7 +60,7 @@ these issues have been solved using block allocaiton instead of continuous alloc ## system calls for file systems - open close, read, write, ioctl, etc -`ssize_t write(int fd, const, void *buf, size_t count)` +`ssize_t write(int fd, const void *buf, size_t count)` - fd - file descriptor - write up to count butes from the buffer pointed buf to the file referred to by the file descriptor - returns -1 if error. and errno is set @@ -82,7 +82,6 @@ these issues have been solved using block allocaiton instead of continuous alloc you can give *advice* to the OS about how to read the file by specifying sequential or direct - # directory structure tree structured diff --git a/content/notes/204-questions.md b/content/notes/204-questions.md new file mode 100644 index 000000000..014279bd5 --- /dev/null +++ b/content/notes/204-questions.md @@ -0,0 +1,9 @@ +--- +title: "204-questions" +aliases: +tags: + +--- + +1. in read and write system calls why is the buffer const in write and not in read +2. diff --git a/content/notes/management-of-file-systems.md b/content/notes/management-of-file-systems.md index 14fc14a58..b2b0600d9 100644 --- a/content/notes/management-of-file-systems.md +++ b/content/notes/management-of-file-systems.md @@ -7,6 +7,20 @@ tags: A file is a collection of related data. They can be thought of as artifacts of the dialogue between the user and the OS +# Attributes The attributes of a file are stored in an index node (inode) which held in a directory. These attributes include: name, owner, type, location, size, permissions, more. -There are two main systems calls for file interaction: write and read \ No newline at end of file +# System Calls +There are two main systems calls for file interaction: write and read. + +# File Access patterns +There are two main types of access: **Sequential** and **Direct** access. + +In sequential access, a file pointer specifies a record within the file. The pointer can then be moved forward (read or write) or backwards (rewind). + +In direct access, a file is viewed as a numbered sequence of records. Operations can be done on any record in any order. + +# Directory structure + + +# Disk allocation methods \ No newline at end of file