Editing a directory?
I had accidentally opened a directory in vi, and it has a list of directories and stuff... that totally freaked me out... so what's going on? *nix systems does treat EVERYTHING as a file I guess?
|
a directory is basically a collection of pointers to files. Its really file system dependent, and has nothing to do with *nix
if you pass a directory to vi, it will not edit it, but display what files there are, and let you pick what file to edit. |
Quote:
It is impossible to "edit" a directory, per say. All editing must come through the system calls (unlink(2) and all those). Now, this is not true in very odd and particular circumstances (aka, you need to work very hard at it -- unmounting a disk and reading the whole thing as a file would be one way to circumvent this... but there is no "good" reason to do this). |
All times are GMT -5. The time now is 02:46 AM. |