Skip to main content
Loading Explore guides…
File Systems Overview · Acedra
Home
Explore
Computer Science
File Systems Overview
Sign in to save
Chat
If YouTube asks you to sign in, open the video on YouTube.
Watch on YouTube
Reload player
Transcript
671 segments
Copy
Hide video
0:02
anything if you don't want it recorded. Okay
0:08
that's the recording and the transcription started and
0:13
as I said you won't be surprised to
0:19
know we're moving on through the chapters and
0:25
today we are getting to file systems. Hopefully
0:31
you've read ahead and you know that and
0:37
none of the stuff that I'm saying today
0:42
will be a surprise to you. Sorry my
0:48
system's just slowed down completely.
0:59
So we'll be covering all aspects of file systems and trying to understand how they
1:04
get together and as part of that of course we'll be looking back at ways
1:10
that we can go about setting up file systems, some of which of course were
1:15
used in early operating systems. But it's always worth remembering how we got to where
1:20
we are and the other thing that's worth remembering is when we talk about file
1:25
systems, same caveat as usual, Don't just think about your system, don't just think about
1:30
what happens on a Windows box or a Mac box, whatever you're using. Think of
1:36
them more widely because we've talked about it before, operating systems cover a lot of
1:41
range and a lot of different types of computer. So it's not just the machine
1:47
on your desk. If we're going to talk about file systems, we should probably say
1:52
what a file is in the first place. And as far as we're concerned, a
1:57
file is just a contiguous logical address space and the logical part is important
2:03
because where we store the file it may not all be in one
2:09
chunk it might be split up we've got all sorts of different types
2:15
of file and they might have different attributes attached to them and again
2:21
don't get too hung up on what the other ones that are on
2:26
the slide there are common ones you know a file name the file
2:32
type what's the file going to be used for? Is it
2:38
a document? Is it a text file? Is it an image? Is
2:43
it an executable? So all the things on the screen just now
2:49
are fairly reasonable and most operating systems have those and sometimes an
2:55
awful lot more besides. So for example here is what you get
3:00
if you look at file information on a Mac. Now remember that
3:06
a Mac underneath its fancy shell is actually unix
3:12
so you'll see a lot of crossover with what unix
3:18
does so here's a file system for mac file and
3:23
it's got a name it's got an extension it's got
3:29
a file size excuse me it's got a file size
3:36
It's got when it was last changed, but a whole bunch of other stuff as
3:41
well, including where it lives, when it was created, who modified it, some stuff that
3:46
wasn't on the previous slide, like a label. So in the Mac operating system, you
3:51
can get them a label and give them colours. You can decide what application you
3:56
want to open files that have a .TX extension with, and you can say who
4:01
you're going to share it with and what kind of access you give other people.
4:07
And that's important for systems that are shared with other people, which
4:13
for us quite often is a lot. You guys are working in
4:18
a group. I'm kind of hoping at some point you have set
4:24
up a shared area on one of your OneDrives or on Teams
4:29
where you can share files and you can all edit and all
4:35
do that kind of stuff. And if you haven't, why not? Wouldn't
4:41
it be easier to work together like that? So if we've got
4:46
these files, we're going to have to do stuff. with these files,
4:52
like create them and read them and write them. And again, as we saw
4:57
in previous lectures, when we were talking about other things, there will be built
5:03
into the operating system an API, an application program interface that allows anybody who's
5:09
writing a program not to have to worry about the detail of how the
5:14
file is saved, where it's going to go, how that's going to be set
5:20
up. You just say save a file, at a particular location with a
5:26
particular name and don't bother me with anything else similarly you can open
5:31
it up again when you do open it up you can look for
5:37
particular things in it so I am going through this PowerPoint file I
5:43
could quite easily say please go to slide 30 and it would jump
5:49
through the file to get to slide 30. So again,
5:55
there will be different things that you can
6:00
do. These are a fairly basic set. Other
6:05
operating systems may have more or fewer functions.
6:11
Sorry, what's the same with Chromebooks? I just
6:16
noticed that there and I don't know if
6:22
it's something I said before. I'll move on.
6:27
You can add some extra. Bless you, Linux.
6:33
Yeah, so Chrome is based on Android,
6:38
which is based on a Unix shell, a Unix
6:44
kernel. So at its most basic, if we have
6:50
a file, we'd probably want to open it. Now
6:55
it's important we keep track of open files because
7:01
it's important we close files afterwards. If you're on
7:07
a single user, single asking system, that's not so
7:13
much of a problem. because when you close down your computer, everything
7:18
closes. But remember that as with other things in the operating system, we have to
7:24
keep track of things. And if you continually open files and don't close them again,
7:29
sorry Connor, I just noticed your face when you ate that. I was actually thinking
7:35
that tangerine looks really nice, but I'm guessing it isn't. Yeah, I thought the same
7:40
until I ate it. Thanks. So we're
7:46
continually opening files, we need to keep track of the files that we have open,
7:50
where they are and what they are. If we keep doing that and don't close
7:54
them, that bit where we're keeping track gets bigger and bigger and bigger and bigger
7:58
until eventually it falls over itself. So it's important that we not just open the
8:02
files, but we close them down again afterwards. We'll also need to know where we
8:08
were. If we're working our way through a file, you've opened a Word document and
8:12
you're working your way through, looking at each page, you have to know where you
8:17
are as you're reading through that file. So you need to know where you are.
8:22
You might be sharing a file. So it's important to know how many people have
8:27
it open. And you can do that. So if you set up a group report
8:31
in your OneDrive, for example, did you know you can all edit it at once?
8:36
And you can see multiple cursors with initials against them to show where people are
8:42
and what they're doing. You can do the same sort of thing with Excel
8:48
and that kind of stuff. But of course, it's important to know how many
8:54
people have that open. And that becomes even more important where you don't realise
9:00
that you're working together. So say you're in a big call centre and somebody
9:06
opens up Alan's record to phone him up to sell him a subscription to
9:11
Bunty magazine monthly. Of course, they're going to accept and
9:17
he's going to update that. But in the meantime, somebody else may have Alan's record
9:23
opened up. So they sell Alan his copy of Bunty magazine. They put that into
9:28
the database. That gets saved back. But someone else has opened up Alan's record in
9:34
the meantime because they're going to phone him because he's just next on the list.
9:39
They realise someone has already taken the call. So they close it. And that then
9:45
overwrites Alan's subscription. So you need to be careful about who has a file
9:50
access and who has the rights to save to. And again, you can sometimes see
9:56
that if you work together, you'll see things like this file has changed since you
10:02
started working on it. Would you like to save a copy instead? So the operating
10:07
system has to take care of all that kind of stuff. It also has to
10:13
take care of whether you're allowed to access it at all. And we saw that
10:18
with the rights We saw that with
10:24
the rights that we had here, who gets to read it and write
10:30
it, who just gets to look at it and who's given no access
10:36
at all. That fancy name for that where you stop people editing because
10:42
you're editing or stop people changing is called file locking. So it basically
10:48
says this file is open, someone else has got it open, they're doing
10:54
something with it. I'm not going to stop you accessing it. but
10:59
you'll have to access it in read-only mode so you can look at it
11:05
but you can't change it because someone else has it that's an exclusive lock
11:11
although sometimes you can have something called a shared lock the idea being that
11:16
you can share a file so if you have that sort of thing where
11:22
you have a huge database file and more than one person wants to access
11:28
it you can often the operating system will give you record level locking
11:34
so the file isn't locked but the record that you're looking at is locked
11:40
so only one person can update it in fact companies like oracle made billions
11:46
of dollars setting up that kind of thing because we think of oracle as
11:52
a database oracle is really more of an operating system because it's all built
11:58
into the operating system and you install it to make sure that the database
12:04
can work properly and then the operating system can allow you to decide
12:09
what kind of locks that you have, whether they're mandatory or whether they're only advisory.
12:15
And again that'll depend on the kind of work that you're trying to do and
12:20
how it thinks you should progress. We also have lots of different file types. Operating
12:26
systems will quite often use a visible file type. So you're all familiar with files
12:31
at end.exe so they'll have an extension so you can look at it and go
12:37
oh executable, oh text file. there's nothing says that it has to be visual.
12:43
So if you go into Unix, you might have a file called thread and there's
12:49
nothing in that file name that says what it is. That doesn't mean it's not
12:55
stored somewhere. It just means that it's not required. And the reason we get so
13:01
used to it is DOS and its successor Windows required an extension to show the
13:07
type of file as it was, but that's not required. It's just a choice that
13:13
they made. and there's
13:18
nothing to stop you even in a Windows system. If you see a .txt file,
13:24
you might think, "Yeah, text file, open it with Notepad." Some of you might even
13:30
have gone on to open it with Notepad++ or WordPad. There's actually nothing in the
13:35
rules that says, "Well, if I see a text file, open it with Chrome." Or
13:41
actually, if I see a file with .txt, I'm going to set that up as
13:47
all my executable files are going to end .txt. it's not a
13:52
rule it just is a link so same as it is
13:58
here it's just a link and it says well if that's
14:04
kind of file here's what I'm going to use to open
14:10
it we also have different types of file now again this
14:15
is one of the ones where I want you to remember
14:21
that we're not just talking about your Windows desktop you get
14:27
different types of files for different types of job so you
14:33
could have a simple file so a text file just
14:39
lines of text. But there's nothing to say that that text can't
14:45
have meaning. After all, an HTML file is just a text file
14:51
that when you put it into a browser gets parsed in a
14:57
particular way to show fancy stuff on a screen. So we can
15:02
have simple files, we can have ones where they're fixed length. So
15:08
we might have something like a transaction in a shop that says
15:16
So fixed length in the first six digits of the date and the next six
15:21
and the next four characters of the time and the next eight characters, the next
15:26
16 characters are the credit card number and so on and so on and so
15:31
on. And we can set up a fixed length file where we know what each
15:36
part of the record is showing. And for record you can read line in this
15:41
case. Or you could decide no actually just have them variable. Text files like that
15:46
you can have different lengths of line on each of them. And that's why you've
15:52
got a simple record structure so you can in essence open it up, look at
15:57
it and get an idea of what it does. That's if you don't move on
16:03
to a binary style file where you have a complex structure and you can have
16:09
all sorts of information in there and it's up to the application program to sort
16:14
that out. And we do that by not restricting ourselves to basic characters. We can
16:20
use any binary value and the program or the operating system can then use that
16:27
to decide what we're going to do with the file. As ever, if you have
16:33
questions, stick them in the chat. It's nice to see the chat going, even if
16:39
it is David just moaning about people not letting him change the line he's doing.
16:45
It can be a pain. So we've got different access methods as well. And this
16:51
is one we don't often think about. This is sequential access. And it used to
16:57
be that I would explain that to people with a cassette
17:02
tape. And of course, people don't use cassettes anymore, so you don't know
17:08
what I'm talking about. But on your screen just now, you're seeing a
17:14
vintage tape drive, an IBM tape drive, actually. And you can imagine the
17:20
data being stored in that. So say you're a bank and you
17:26
have a transaction, you don't really need to store those in any particular order. You
17:32
just have a transaction store, have a transaction store, have a transaction store. And something
17:37
like a simple tape drive does that really well. So you have each bank location
17:43
has its own computer and you store all the transactions on a tape. And then
17:49
later on, you take those tapes. and you go through them and you reconcile
17:55
the transactions that have happened during the day with your account. And you've probably
18:01
kind of come across that where you've spent something but it hasn't quickly come
18:07
off your account and it only happens overnight. Or if you've got a paycheck,
18:13
it's happened overnight because there's a list of people that are going to pay
18:19
and it gets run overnight. And even though I'm showing you a 1959 IBM
18:25
tape drive, That's misleading. 8
18:31
drives are still integral to large computer systems. Don't
18:36
know what's up with my IT today. My daughter
18:42
must be downstairs watching Netflix or something. They're integral
18:47
to a lot of systems because, well, does anybody
18:53
want to guess why they're still well used? Is
18:58
their cheap and they offer cheap large storage? Yeah,
19:04
that's the only reason. That's the only reasons I
19:09
can think of. And they are the reasons it's cheap
19:15
and you can get a lot of data in there. So people will
19:21
still install tape libraries, massive big cabinets full of tapes so that you
19:27
can do archives or so that you can save a lot of data.
19:33
If you're saving stuff onto one of these cloud systems like AWS or
19:39
Azure, do you really think they've got a whole bunch of hard disks?
19:47
and I mean they do but a lot of the stuff that's stored onto these
19:53
things is really accessed so what do you do you put it onto something that's
19:58
really cheap and can store terabytes of data that's what they're doing here we're setting
20:04
up all these cabinets each one of those wee red boxes is going to store
20:10
eight terabytes of data in one wee box look at
20:16
how many cabinets and how many of those fit into
20:21
each of those cabinets and think about how much data
20:27
you're storing with that. And I really want to get
20:32
this one going because of course if you've got that
20:38
many tapes you probably don't want to access them manually.
20:43
Instead you want to set up a wee robot that
20:49
will go grab your tape, put it in the tape
20:54
drive and read the data that you want. And these
21:00
are still used in massive systems. because they're not
21:05
storing a bunch of work documents and some videos they're storing
21:11
terabyte upon terabyte upon terabyte of data that can't be lost
21:17
and so these are cheap they are big and it's easy
21:23
to keep a copy or multiple copies and it doesn't cost
21:29
a fortune and all of those tape drives
21:35
use sequential access. You read a bit, then you read the next bit, and then
21:41
you read the next bit. And if you want to jump over 100 records, you
21:47
have to physically zip through the file in exactly the same way. You have to
21:53
physically zip through the tape in exactly the same way as you did in 1959
21:59
with this kind of tape drive. The same sort of thing that you see on
22:05
a vintage sci-fi film. So we'll have sequential access. and
22:11
it is slow yeah it is slow Connor because you don't have random access you
22:16
only have sequential access and you have to zoom through them to get to where
22:21
you want which is why it's better for particular types of storage so as I
22:26
say if you're storing a whole bunch of transactions you don't really care what order
22:30
you're doing them you're storing them and then you're going through them to process them
22:35
you're not sort of zooming back and forth to try and get a different bit
22:40
and And that's what I'm saying, Kelly, it's not vintage. It's absolutely
22:46
up to date, even though we don't think it is. If you're doing a backup,
22:51
if you're backing up your hard disk, you don't mind that it's slow to get
22:55
to a particular part of the disk. Because if something happens and you lose your
23:00
hard disk and you want to restore it, do you know you'll wait that extra
23:05
30 seconds till the tape spills through to get to the bit that you want?
23:11
because if nothing else it means that you can buy a new
23:17
tape for a fiver every day and back up every single day
23:23
and it's not going to break the bank particularly if that data
23:29
requires to be stored we don't have sequential access then we've got
23:35
direct access and that's the one that you're more familiar with you
23:40
can just have a type of storage system that can go immediately
23:46
to a breakup and that's just pointing out that when you have
23:52
these types of file structures keep doing that keep pointing to
23:58
my screen instead of yours when you have a file structure with a simple
24:04
record structure then you simply will go through it by saying okay you start
24:09
at the beginning add on whatever you need to the pointer to get to
24:15
the next record and then keep going you can start to expand that out
24:21
so say you do have a four terabyte tape drive and you've got a
24:26
one terabyte desktop system and you want to connect up your backup
24:32
tape drive to your desktop. Well, the first thing you back up, you've maybe got
24:37
half a terabyte and that goes on to the tape. And then the next thing
24:42
you back up, you're not backing up everything, you're just changing what you're just backing
24:47
up what's changed. So you may have a couple of gigabytes and then another couple
24:52
of gigabytes. So you end up with a whole set of backups all in that
24:57
one tape. So you might want to add on to your a storage method by
25:02
saying okay well rather than just putting them one after the other let's have a
25:07
wee index so that we know how far to spill through that tape so we
25:11
can start to create an index saying okay well at position 10 we'll put this
25:16
back up here and at position 120 we'll get that back up here and even
25:21
within that you can say okay well within this backup we have file one file
25:26
two filthy in other words we have an index that says where things are
25:32
and I'm talking about that for a tape but of course we have indexes for
25:36
everything if you're doing it off a tape then you go you read the index
25:41
you read where the file is going to be and then you go to it
25:46
and that is slow but actually the same thing happens with a disk you go
25:50
to the disk you read the index for the disk and then you go to
25:55
the place on the disk so you tend not to read the index every time
26:00
instead you keep the index in memory so when you start up with your disk
26:05
you bring in the index And if it helps, whenever I say
26:11
index, think of list of files or directory structure or however
26:17
it helps you to visualise that. When you start up, you
26:23
read the index and you bring it in so that when
26:28
you need that, you can go directly to the file on
26:34
disk. Anybody see any flaw in that plan with your one
26:40
terabyte disk? Just to do with the size, it will fill
26:46
up so quickly. Yeah, your one terabyte disk could have hundreds of thousands of
26:52
files on it. And if you have to have an index for each one of
26:57
those files, well, you do have to have it because you need to know where
27:02
they are. But if you're going to bring that whole index into memory, you're going
27:07
to have a problem and you won't have room for anything else with those hundreds
27:12
of thousands of files all being indexed in memory. So you can have dual layer
27:17
indices. So you can have an index of the index. So you can balance
27:23
it so that you can say, okay, let's bring in the index of just
27:28
the directories. And then when we need something in the directory, we'll go to
27:34
the disk and we'll read the index of that directory. Other operating systems could
27:40
do it in other ways. They could look at, and we've looked at these
27:45
before for other reasons, most recently accessed, least recently accessed, all that kind of
27:51
algorithm we can use to decide, oh, which ones do we actually need?
27:58
And different operating systems will implement different versions of that. And you
28:03
see the one there called indexed sequential access. And that's what I'm
28:09
talking about for the tape. So you keep an index, but you
28:15
still have to sequentially go through the tape to get it. But
28:21
the key point to all of this is the user doesn't know
28:27
about it. The user doesn't care. The operating system takes care of
28:33
that for them. And ISAM is used daily. It's still a
28:39
big thing in commercial systems. VMS, not so much. There's still some about there, but
28:44
mostly virtualised now. But it's not the point because we use these same sort of
28:50
structures now. So we can have an index that says, okay, we want to look
28:55
up the record for John Smith. And that then tells us where it is in
29:01
the file. So the file itself can have an index. And again, think database.
29:07
It doesn't take long to get to a file in a database
29:12
and you do that by looking up the index. And databases can
29:18
have multiple indices. Look it up on surname, date of birth, car
29:23
registration number. It's entirely up to you and it depends on the
29:29
application that you're running. Everyone happy with that before we move on?
29:34
Okay. So quite often what you'll want to do is not just
29:40
have a whole pile of files. Instead, you'll want to organize them
29:46
somehow. So we might want to set up directories, Windows calls and folders.
29:52
It just says, okay, all the files in here pertain to something. All
29:57
the files for a particular application, all the files for a particular user,
30:03
all the files for a particular project, whatever it happens to be. So
30:08
we're going to have to think about how we set that up as
30:14
well. So before we do that, let's pause to think of what we
30:20
actually have as a storage medium. So we've talked about tapes where
30:25
it's just a whole series of data, one after the other, for serial access.
30:31
We mentioned that we had direct access for newer devices like disks. But it
30:37
doesn't just happen by accident. We need to set up that disk. So the
30:43
first thing we can do is give the disk a partition. Now often disks
30:48
only have one and the disk and the partition are the same thing but sometimes
30:54
you can have multiple partitions so you can divide them up in different ways. So
30:59
we were talking about backing up your machine. The first thing I do when I
31:04
get a new machine is I split the disk into two partitions. One is for
31:09
operating system and executables and one is for data. What I do when I'm setting
31:15
up my backup is I say back up my data partition ignore the operating system
31:20
and executables partition. Why? Because I can reinstall those. I have the, I was going
31:25
to say I have the disks, but it's not a disk anymore. Most of the
31:29
downloads these days, but you get the point. I don't need to keep a copy
31:34
because someone else has kept it for me. The data on the other hand is
31:38
mine and I want to back that up. So that means that my backup is
31:43
much faster. I'm only storing the stuff that I need to. So you can do
31:49
that in different ways. It can be for that, it can be for different
31:54
users, each user can have a partition on the disk, you can have it
32:00
for different reasons. So it might be that you have a media machine and
32:05
you decide that one partition is going to be for general computing and one
32:11
partition is going to be for video rendering. And that's important
32:17
because the other thing that you have to do to a partition is format it.
32:22
And again, we tend not to think about it. Occasionally we'll stick in a new
32:27
USB drive and it'll ask us whether we want FAT32 or FAT64 or FAT16 or
32:32
something. But actually there's a whole queen, queen's a technical term by the way, and
32:37
if you're not from Scotland, it means lots. There's a pile of different file systems
32:42
that you can use. and you can format them based on what you're
32:48
going to use that partition for. So if you've got huge video files where
32:54
you know that each video file is going to be 4, 5, 6, 10
33:00
gigabytes, you might want to choose a different file system than if you get
33:06
a general purpose system where rather than having a few large files, you've got
33:12
lots of small files. So when you set up that file system, that's then
33:18
called a volume. And again, some things you'll have seen
33:24
that if you stick in a USB drive, it will say installing volume threads
33:30
USB. And one of the things that the file system will have is some
33:35
sort of organization to it, a way to subdivide it into directories and to
33:41
know where things are. So you can end up with quite complicated file systems.
33:47
You can have multiple disks. So here's a single machine with three different disks.
33:55
Disk one is partitioned twice, one for executables and operating system, one for
34:01
general purpose files. And the third one here is set up with a
34:06
different type of file system. And it's for the example, this could be
34:12
for the example I was giving you for video rendering, where we have
34:18
two disks where the one partition covers two disks, because we know that
34:23
we're going to be using huge files. So rather than saying, oh, well, is it
34:29
on drive D or is it on drive E? You just say, no, it's on
34:34
my videos partition and let the operating system sort out whether it's on disk two
34:39
or disk three. You just treat it as one huge partition. So we've got all
34:44
of these kinds of options. And if you think about it, of course you do.
34:48
Do you really think that when you go into your OneDrive and we all go
34:53
onto a OneDrive, do you really think that's one disk somewhere sitting in a machine?
34:58
Of course not. It's a whole pile of different devices
35:04
that are logically treated as one drive. So as I
35:10
said, we can have lots of different, we do have
35:16
lots of different file system types. They are for different
35:22
reasons, for different applications, for different purposes, and you would
35:28
choose those. Now hopefully many of you, given that the
35:34
assessment is to talk about Linux. Hopefully you have by now
35:39
installed Linux in at least in a virtual machine. And one of the
35:45
things that Linux asks you when you install it is what type of
35:51
file system do you want? So it's more, you can tune it more
35:56
closely to what you're going to use that system for. So as a
36:02
general purpose thing like Windows, it just says, yeah, I'm formatting it, I'm
36:07
partitioning it. I'll let you know when I'm done. something like Linux
36:13
gives you actually more control over what you're going to do. Everyone happy with
36:19
that? I'm keeping an eye on the slide numbers. I'm trying to decide whether
36:25
to take a break or whether to just power through, particularly if we've got
36:31
to get to campus. I think we'll power through just now. Okay, so we
36:37
have to do things within a directory. Open files, delete files, you know, nothing
36:43
major, nothing that you don't already know. But of course, the operating system has
36:49
to provide these functions for you. This isn't something that every
36:55
user writes or everyone who writes a program has to redo.
37:00
You just ask the operating system to open a file, write
37:06
to a file, delete a file and organize files. And one
37:12
of the things that the operating system has to do is
37:18
make sure that the files can be accessed efficiently. You don't
37:23
want to say open, you don't want to open your MP3
37:29
and be sitting there while it's going, oh yeah, MP3s, let's see, they're in
37:35
partition two and they're in a directory called music and in a sub directory
37:41
called simple minds, the worst band in the world and a file name called
37:47
alive and dying. Yep, here you go, here's your file. You wouldn't hang about
37:53
for that. So you want to be able to get access to a file
37:58
quickly. And you also need to have something that's robust enough to have
38:04
duplication and if you've got multiple people using a system, odds are
38:10
that at least two of them are going to have created a
38:16
file called dummy.txt or cv.doc. So they're different files but they're the
38:22
same name. We actually also have the other issue. We have files
38:28
that are the same but people have different names for them.
38:34
and again those mp3s could be an example they're exactly the same data in them
38:40
but somebody might call them simple minds alive and kicking someone might call them alive
38:46
and kicking simple minds however they want to to recognize them we also want to
38:52
give a way of grouping files so in the beginning we didn't really have that
38:57
we basically had one big directory all your files are in one place and
39:03
we had that problem with naming. If everything is one place, you clearly need unique
39:08
names. Otherwise, how do you know which dummy.txt are you going for? We also don't
39:14
have any way of thinking about the files. They're all just in one big lump,
39:19
exactly the same way as your grandmother saves all her files. All in one big
39:25
lump in one place, usually the desktop. And you just go on, there's just piles
39:30
and piles and piles of files, and nobody can ever find anything.
39:36
So we start to think, well, maybe we can be a bit more organised about
39:41
it. Maybe we could have a couple of levels. So here's an example where it's
39:47
a multi-user system. Each user has their own directory and then they can store their
39:52
own files in that directory. So that's a wee bit better. We can have two
39:58
people calling a file A. Everybody's called a file A. We can get to things
40:03
a bit more efficiently. If you know it's user 3, you can go to user
40:08
3's files. but we still don't have any grouping so we can move on
40:14
and think okay well if we can have a second level maybe we can have
40:20
a third and a fourth and that takes us to the one that you're familiar
40:26
with just now a tree style directory where you create directories and those directories can
40:31
either have files or other directories and that can go down and down and down
40:37
and down as many ways as you want and that's really helpful because it's efficient
40:43
you know it's If you want a particular file, you say programs p
40:49
list and you just walk your way through the tree to each level
40:54
and that's very quick. They are grouped so we can say right all
41:00
our mail stuff is in our mail directory. Cool, it's all here. All
41:05
the programs that are to do with mail are in the mail programs
41:11
directory. So it's grouped and it gives us something to work with.
41:18
to understand how the files are organized and
41:23
it gives us a way of accessing all
41:29
the files with a unique structure what file
41:34
do you want i want oops volume c
41:40
spell mail prt last again you have seen
41:46
that something like this so we have this
41:51
which is a an absolute link to that particular
41:57
place. In other words, it starts at the top and works its way
42:03
down. So that's an absolute link. We could also have a relative path
42:09
name. So if we start that spell mail prog, spell mail prog, we
42:15
could change into the mail directory by going up one. That would be
42:20
a relative move, move up one level in the tree. Or we could
42:26
move down one by saying CD1 down. So we can either access things
42:32
in an absolute manner from the top of the tree, or we can access them
42:38
based on where we are. So if we're in prog, we can simply say spell
42:43
and it knows that we mean the spell that's in prog. Or if we're in
42:49
prog and we say list, it knows we mean list. And the operating system doesn't
42:55
think, oh no, you mean this list all the way over here. That wouldn't make
43:01
sense. So this gives us absolute and relative
43:06
access to every file on our system. And the work that
43:12
we do is based on our current place in that tree
43:17
file, our current directory. And there you can see some commands
43:23
that will actually work in your Windows system right now. You
43:28
can make a directory and give it a name. And yeah,
43:34
it is Connors. All modern systems use that kind of tree
43:39
structure. Some
43:45
get a little bit more complicated and they use not
43:50
a tree. Now the difference, just to be clear, this
43:56
is a tree. There's no recursive links. There's no sideways
44:02
links from here to here so that you could have
44:07
a loop. So you can't link this one to this
44:13
one. Some systems like Linux, though, do allow you to
44:18
do that. And they actually have a specific link command.
44:24
So you create not a tree, but a graph. And
44:30
there's a good reason for that. So say you are writing
44:35
a word processor and that word processor has both a dictionary and a spell checker.
44:41
Now how you work the dictionary and how you work the spell checker, you know,
44:47
the code for that is different. But both of those use a list of words.
44:53
And why would you keep two lists of words on your system?
45:01
So dictionary sees its list of words as W and points
45:06
to this list. Spell checker sees its list of words as
45:12
words and points here. So instead of each line in the
45:18
tree being unique, we suddenly have a closed graph so we
45:24
can work our way through. That has its own issues.
45:30
So we've got a couple of different names for things. Here
45:35
we've called the word list, its actual name is list, dictionary
45:41
calls it w, spell calls it words, but they're pointing to
45:46
the same thing. If, and the reason it caught the same
45:52
thing is because they also have a list for themselves. So
45:57
here it's a list of the incorrectly spelled words. So spell checkers
46:03
call something list for its incorrectly spelled words and it's called words for
46:09
its word list. So it starts to get a bit more complicated. If
46:15
you delete the list in dictionary, for example, you need to make sure
46:21
you get rid of this too. You can't just leave that sitting there.
46:27
So you have to get rid of everything underneath it. That becomes trickier
46:33
when more than one thing points to it. So say dict
46:38
deletes W. Well, W is just pointing to list. Do you delete
46:44
list? Well, no, because words also points to list. So you need
46:50
to keep a note. It's called a back pointer. And in list
46:56
it says, okay, I'm pointed to by here and I'm pointed to
47:01
by here. So if one link is changed, list will hang about.
47:07
But if everybody deletes it, they go, oh no, I'm not needed
47:13
anymore. I will silently expire. if that's what you want
47:19
to do because it's quite possible that that's a file that you don't want to
47:23
lose in other words it might be a system resource but just because nobody's pointing
47:28
to it just now doesn't mean nobody will want to point to it later so
47:33
it might simply say okay nobody's pointing to it just now but I won't delete
47:38
myself I'll just say yeah I don't have any using me just now so it
47:42
starts to get a little more complicated where we have links where we
47:48
have to resolve that link to understand what we're pointing to and then we end
47:54
up with things like this where it can start to become a lot more tricky
47:59
and again for those of you that are doing Linux and those of you that
48:04
have installed Linux for this you'll know that there's a link command where you can
48:09
set that up so you say link give it the name that you want to
48:14
use and point to something else and that allows you to use the name that
48:19
you want Where we have that and where we
48:25
have multiple pointers creating real loops and all sorts of things happening with book pointing
48:30
to AVI which points back to book, it becomes a bit tricky. So we can
48:35
either say things like, well, no, you're not allowed to do that, or you can
48:40
do something called garbage collection, which is to say every so often you go through
48:45
this graph and say, have we any dangling links, anything that doesn't point to AVI?
48:50
something that should, anything that points to something that's now deleted
48:56
and we do the garbage collection to make sure that all
49:02
the connections are okay. Everyone okay with that? Okay. Next thing
49:07
we want to think about is mounting a file system. And
49:13
again, those of you that just work on your own Windows
49:19
machine don't really think about that too often. Maybe sometimes when
49:25
you've put in a USB drive and you pull it out and Windows complains
49:30
that you didn't actually unmount it properly or eject it, I think Windows calls
49:36
it. But all file systems have to be mounted. In other words, the storage
49:42
devices have to be accessible to the file system somewhere. And that's called a
49:47
mount point. Quite often that's taken care of automatically. And if you
49:53
stick a USB drive in your system, it will be automatically mounted. The
49:59
operating system will detect that you've got a USB drive and it will
50:05
put something into your file manager saying USB drive thread. Other systems make
50:11
you mount the system manually and even Windows acknowledges this. So you have
50:17
a OneDrive. You can add OneDrive to your file system on Windows, but
50:22
you have to explicitly point to it. So on my file manager in
50:28
windows i've got a pointer to my onedrive which means i can save things to
50:33
onedrive or i can save them locally and i don't now have to think about
50:37
it as far as i'm concerned it's just a storage space and i want to
50:42
copy something from one place to another the operating system sorts that out for me
50:47
too so quite often we don't think about mounting as being an issue
50:52
Because particularly for our consumer focus systems that we're often on, it's taken care of
50:58
automatically because you don't want people thinking, what's mounting? Why do I have to mount?
51:03
What are you talking about? So quite often they'll be done automatically and they'll be
51:08
put in places that we would expect to see them. So different drives get different
51:13
drive letters, for example, or different names with an icon on the desktop, whatever it's
51:18
going to be. so that's quite often at
51:24
the root of our system there's nothing that says it has to be
51:30
at the root you could mount them anywhere you want so on Linux
51:36
I think it's /usr/dev for devices is that right and something like that
51:41
and all your devices your hard disks your all your I/O devices in
51:47
fact will have a mount point in there
51:54
The other thing that we'll want to have the operating system
51:59
take care of is file sharing, being able to share a
52:05
file between individuals or groups or both. And again we saw
52:11
that earlier when we looked at the Mac system way way
52:17
back because we had some things that were individuals, so Greg
52:22
a person, we had staff that's a group and everyone which
52:28
is a group And we can give specific permissions to
52:34
individuals and or groups and they can be different. So the
52:40
operating system takes care of that using file permissions and directory
52:45
permissions. Of course, we have to be in some sort of
52:51
protection to ensure that we only give access to files that
52:57
we want, that they're only allowed to do certain things. So
53:02
again, you saw in that Some users were allowed to
53:08
read and write, so they're allowed to alter the file. Some users were just
53:14
allowed to look at the file and some users were locked out altogether. Everybody
53:20
in this meeting has a OneDrive, which is all stored in one server in
53:26
essence. But I can't get access to your files and you can't get access
53:32
to my files. Unless of course I choose to. So all the module materials
53:38
which you have are stored in a file it just
53:44
happens to be a OneNote file. This is
53:49
stored on my drive and I've given you
53:55
a link to it. That's the link there
54:00
to my SharePoint in my personal directory with
54:06
Tony Gurney at VWSAC UK and a link
54:12
into the file. But of course I haven't
54:17
given you edit on this. I've only given
54:23
you view because that's for a guest contributor.
54:29
So you can look at it but you can't
54:35
go in and start typing stuff. At least I hope you can. But
54:40
of course I could on mine. So we have to decide what sort
54:46
of permissions we want to give people, what sort of access we want
54:52
to allow them. And we're going to have to set up some sort
54:58
of device to allow us to share those files across a network. There's
55:04
one called NFS that you'll see quite often. That's a quite common one
55:10
to use. To do that, we'll need to identify people. So
55:15
we start and get into the idea that the operating system also has to keep
55:20
track of users so they'll have an ID. We might want to group users together.
55:25
So we've got the sales, we've got marketing, we've got accounts, we've got whatever. So
55:30
the users can get put into groups and the group will have an ID. And
55:35
then we can use all those to allow us to share either on our own
55:40
physical machine or remotely over a network. and
55:46
that's exactly what I've given you here I've allowed you to access it over
55:52
a network and we use a distributed file system to do that over the
55:58
web and you probably saw I hope you noticed when I brought up that
56:04
link that it started off https which said it's a an http hypertext transfer
56:10
protocol so that means it's going out over the internet s means it's secure
56:16
and then a URL that points to where that file is
56:22
somewhere, somewhere out there. And the reason we had all those
56:27
characters at the end is because that's a way of giving
56:33
us a unique identifier for that file. So every file that's
56:39
created on OneDrive gets that 64 character, I think, unique ID,
56:44
which means you can access every particular file using that same
56:50
type of URL. So we have different ways of setting that up.
56:56
Quite often we use a client server model so that there's a server sitting somewhere
57:01
and that's got its own files and that's got its own access. We're on our
57:06
clients here and our client accesses that server and that's what happens when we access
57:12
OneDrive. There's a OneDrive server, we're accessing it, say, from our Mac client and that
57:17
allows us to get access to it. But of course we need a protocol to
57:23
do that. We need a way that we have agreed that we will
57:28
access those files and there's a few already spoken about NFS and that's
57:34
a very common one because that came out with some of the early
57:40
Unix systems and has persisted often new ones come in to give you
57:46
extra features so sifts for Windows and we need all the the sub
57:51
systems to let us also access them so that would say http:// and
57:57
then it gave a name. Well, that name is just a bunch of characters. Where's
58:03
that actually going on the system? So we need something like DNS to give us
58:09
our name. That's the domain name system. We need LDAP, which gives us user information.
58:15
So all of these systems come together to allow us to do that kind of
58:20
stuff and to allow us to decide what we want to share with whom and
58:26
what a privileges we want to give them
58:32
for each particular file or directory. For Unix and
58:37
for your Linux systems, the access mode is set
58:43
up like this. So we have read, write, execute,
58:48
and we have three chunks of read, write, execute,
58:54
and it uses a binary format. So it uses
59:00
one byte. Sorry, it uses one word. We have
59:05
three numbers, each of one byte.
59:11
and the numbers correspond to a binary read write execute so here we've got
59:17
read is on write is on execute is on that's one one one that
59:23
gives us seven for public access read is off write is off execute is
59:29
on that means it's one so you can you'll see these when you look
59:35
at the system and you'll see for access rates you have for the owner
59:41
the group that that owner is a member of and everyone else and you
59:47
can change those you can change the rights that you give people so you
59:53
could say no I don't want anybody to have access but me so you
59:58
could say chmod 700 and then the file name and that would say well
1:00:04
owner gets everything group gets zero read zero write zero execute and public gets
1:00:10
zero as well It's entirely up to the user how you want to set those
1:00:16
up. That's for a command line interface for Unix. Something like Windows will do it
1:00:21
slightly differently. It will try and make it a bit more nice. It will say,
1:00:26
okay, here are all the groups and all the users that we have. Choose one
1:00:31
in this box. And then in this box, say, what do you want to give
1:00:36
them? What do you want to allow? What do you want to deny? And you
1:00:41
can see there's different types of permissions there. Execute, read, write. as with
1:00:47
Linux, but some others as well. So Unix puts write and
1:00:53
modify in the same group. Windows decides to have a separate
1:00:59
one for this. So you'd set it in Windows like this.
1:01:04
And if you go into Linux and get an extended file
1:01:10
listing, it will give you the access rights and amongst all
1:01:15
the file names. And it'll tell you who gets to read
1:01:21
access, who gets to have rate access and who
1:01:27
gets to have execute access. And one extra one,
1:01:33
which specifically says whether we're looking at a directory
1:01:38
or not. So the directories have a D against
1:01:44
them in the files, just have the dash. And
1:01:49
I'm glad I powered through because that's what's done.
1:01:55
Does anybody have any questions? Light pause, till I
1:02:00
see if anything comes up in the chat. Slow
1:02:06
typist Simone.
1:02:30
Okay I'm not seeing anything come up
1:02:35
on the chat. Can I just get
1:02:40
a word with you before you head
1:02:46
out? Yep. Okay I've not seen anything
1:02:51
come up in the chat. I'm not
1:02:57
seeing any hands pop up. So let
1:03:02
me stop the recording there. Bye.
Here to help you learn
Sign in to keep a private conversation with your course tutor.
Ask me anything about the material…
Sign in to chat