[RESOLVED] Underlying mechanism of renaming file / folder
Hi,
When I rename a file / folder, the renaming process seems to be independent of the size of the file / folder. Therefore it is clear that this renaming process does not involve the creation of a copy with the altered name and the deletion of the original file / folder.
Therefore what actually happens?
Thanks
Re: Underlying mechanism of renaming file / folder
A typical file system stores meta-data on disk for each file, directory, etc. Renaming a file is then just a matter of re-writing the bytes on disk that store the name.
gg
Re: Underlying mechanism of renaming file / folder
Hi, does this mechanism have a particular name, which I can type into a search engine to find out more info? Thanks.
Re: Underlying mechanism of renaming file / folder
No, but you could search on a particular file system to learn how it works in more detail. FAT is fairly simply.
gg
Re: Underlying mechanism of renaming file / folder
Thanks. Following your suggestion I did a search and found that the NTFS article in wikipedia contains useful information :
"The Master File Table (MFT) contains metadata about every file, directory, and metafile on an NTFS volume. It includes filenames, locations, size, and permissions. Its structure supports algorithms which minimize disk fragmentation."
Re: Underlying mechanism of renaming file / folder
from the old DOS days. FAT16 was the File Allocation Table structure of 16 bit words that allowed access to 'huge' hard drives. There were 2 copies on each drive.
deleting a file just meant changing name.txt to ~ame.txt, and Norton Undelete gave you a list, allowing you to replace the ~, to recover the file name