On Sat, Aug 19, 2000 at 12:19:21AM -0400, Mike A. Harris wrote:
> I swore there was a basename() function in libc...
> 
> Can't for the life of me find it, or figure out what could be
> used in its place.  I can easily write my own replacement
> function, but in the interest of not adding cruft to applications
> I'd prefer to use a premade ready to roll function from an
> existing library, preferably libc..
> 
> So... what's it called, and where is it?  Slap me with a
> clue-by-4...

[root@gateway /root]# cat basename-test.c
#include <stdio.h>

int main()
{
    printf("%s\n", basename("/usr/bin/perl"));
}
[root@gateway /root]# gcc -o basename-test basename-test.c
[root@gateway /root]# ./basename-test
perl
[root@gateway /root]# rpm -q libc
libc-5.3.12-31

        Cheers,
        Mike
-- 
 .--.  Michael J. Maravillo                  office://+63.2.894.3592/
( () ) Q Linux Solutions, Inc.                http://www.q-linux.com/
 `--\\ Open Source Consultancy / Support / Training / Software Dev't.



_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

Reply via email to