Re: directory data structure
- From: sid <kingsiddharth@xxxxxxxxx>
- Date: Sat, 28 Jun 2008 09:08:25 -0700 (PDT)
On Jun 28, 7:15 pm, Maxwell Lol <nos...@xxxxxxxxxxx> wrote:
sid <kingsiddha...@xxxxxxxxx> writes:
Hi
I want to write a C program that can read directories (say list them
as well).
I found out that we could use an API provided by dirent.h header file,
but I am not too keen on using the API. I want to access it directly
without any API. Any help is welcome.
This doesn't make any sense.
If you don't want an API, then why use C?
You could use the API built into perl. But that's another API.
If you truly want to NOT use an API, use shell commands, not C.
Use dd(1) to read raw data from the disk and enjoy parsing binary
information, where you need the info in the *.h files.
Or use ls(1), find(1) and other shell commands.
Actually what I was thinking of was that since everything is a file
in
a Linux kernel/system, I would just read the directory files and
interpret them... and I know that we could do so in the older
versions
of Linux as well as UNIX. Say, if you wanted to read the current
directory, you could just do "od -bc ." and this would octal dump the
contents the of current directory. Also, even now you could read the
contents of the directory file using VI ( vi <directory name> ). So I
planned to do something similar and was thinking that you guys might
help me with it.
Thanks
.
- Follow-Ups:
- Re: directory data structure
- From: Maxwell Lol
- Re: directory data structure
- References:
- directory data structure
- From: sid
- Re: directory data structure
- From: Maxwell Lol
- directory data structure
- Prev by Date: Re: Good 2003 post on why to avoid Linux: Linux is a confused mess of beta quality software.
- Next by Date: Re: directory data structure
- Previous by thread: Re: directory data structure
- Next by thread: Re: directory data structure
- Index(es):
Relevant Pages
|