1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
<HTML>
<HEAD>
<TITLE>TSP (libtsp/FL) - FLdirName</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFACD">
<H2>FLdirName</H2>
<HR>
<H4>Routine</H4>
<DL>
<DT>
int FLdirName (const char Fname[], char Bname[])
</DL>
<H4>Purpose</H4>
<DL>
<DT>
Return all but the last component of a file path
</DL>
<H4>Description</H4>
This routine takes a file path specification and returns all but the
right-most component of the file name. Components are separated by /
characters. If no / character appears in the name, an empty string is
returned. For MS-DOS, the directory separator character is \.
<P>
Examples:
<PRE>
"abc/def" => "abc"
"abc/def/" => "abc/def"
"abc/bcd/def" => "abc/bcd"
"/abc/def" => "/abc"
"/abc/bcd/def" => "/abc/bcd"
"./def" => "."
"def" => ""
</PRE>
Special cases:
<PRE>
"/def" => "/"
"/" => "/"
</PRE>
<H4>Parameters</H4>
<DL>
<DT>
<- int FLdirName
<DD>
Number of characters in the output string
<DT>
-> const char Fname[]
<DD>
Input character string with the path name
<DT>
<- char Bname[]
<DD>
Output string with the all but the last path name component. This string
at most FILENAME_MAX characters long including the terminating null
character.
</DL>
<H4>Author / revision</H4>
P. Kabal Copyright (C) 1997
/ Revision 1.18 1997/10/14
<H4>See Also</H4>
<A HREF="FLbaseName.html">FLbaseName</A>,
<A HREF="FLdefName.html">FLdefName</A>,
<A HREF="FLexpHome.html">FLexpHome</A>
<P>
<HR>
Main Index <A HREF="../libtsp.html">libtsp</A>
</BODY>
</HTML>
|