Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: renaming a file and moving into another folder

by zentara (Archbishop)
on Sep 21, 2011 at 17:57 UTC ( [id://927188]=note: print w/replies, xml ) Need Help??


in reply to renaming a file and moving into another folder

I am sorry that I got long winded here

But all the schoolbooks show the hard drive to be a big file cabinet, with multiple drawers, labeled A- Z. Did my teachers lie to me ? :-)


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: renaming a file and moving into another folder

Replies are listed 'Best First'.
Re^2: renaming a file and moving into another folder
by Marshall (Canon) on Sep 21, 2011 at 18:40 UTC
    But all the schoolbooks show the hard drive to be a big file cabinet, with multiple drawers, labeled A- Z. Did my teachers lie to me ? :-)
    No. I wouldn't say that they "lied". I would say that they simplified things at the beginning and you may have missed the reality checkpoints later in the curricula. Please do not get offended. This misconception is common. In Unix you should look at the link count associated with a file.

    Basically I am saying that the file system directory associates a text name with essentially a starting byte number on the hard drive. There can be more than one text name associated with the same byte number on the hard drive. These are called "hard links".

    So, I would say that it is a pretty good approximation to say that the hard disk gets divided up into blocks. A file is just a name in the directory that points to a sequence of these blocks. More than one file name can point to the same sequence of blocks. These blocks on the hard drive are not reused until the reference count to them drops to zero (this just like Perl reference counting).

    So, a more accurate description would be that there are file cabinets with drawers, folders and documents. You have a spiral bound book that associates a "text name" and a file/folder in cabinet1, drawer2, folder3,document5. There may be more than one name in your spiral bound book that points to exactly the same place! Your spiral bound book is what a directory entry is.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://927188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-05-30 06:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found