Re: A function for ls?
- From: Helmethead <hoshem mel comcen com au>
- To: Dave Neary <dneary eircom net>
- Cc: Germano Rizzo <manomano ciaoweb it>, gtk-list gnome org
- Subject: Re: A function for ls?
- Date: Sat, 24 Feb 2001 13:39:23 +1100
On Fri, Feb 23, 2001 at 08:25:56PM +0000, Dave Neary wrote:
> On Fri, Feb 23, 2001 at 04:24:04PM +0100, Germano Rizzo wrote:
> > Hi!
> > is there a library function that gives the contents of a directory?
> > Something like 'ls'... or a way to do it using other functions? At least,
> > may you address me to a program that uses such a function, to learn on it? I
> > browsed the source of ls, but it's... too much! ;)
>
> Yes there is, but (obviously, being a system call) it's not
> portable.
>
> The POSIX way to do it is to use operdir(), dirent(), rewinddir()
> and closedir(). These should all be in section 2 of your man
> pages... chdir() and fchdir() can be used to change directories,
> and then normal file i/o operations can be used once you have the
> file(s) you want.
section 2 is system calls, those are like you said library calls (section 3) :)
ok no more traffic for the non gtk question now
>
> > Mano :)
>
> Cheers,
> Dave.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]