> How experienced are you in Linux?
> Linux doesn't really have "drives".

I understand. I'm pretty experienced, just not with programming. I forgot
to mention the fact I didn't need drive info.

> If you want to split between path and filename,
> simply start at the end of the string and work
> backward until you hit a '/', which delimits
> directories.  Everything after the last '/' is
> the filename, and everything before it is the
> path. 

Thanks. If I understand what you're saying I write

while(*string[i] != '/') {
        i--;
}
then I take the value of i and take the characters from i to length of
string and have the filename?

(Pardon if the syntax is wrong - probably is horribly wrong - but I don't
feel like looking it up at the moment.)

> I'm sure there's a call to find the current
> working directory if you want the absolute
> path and the first character is '/', denoting
> the root directory.  Just remember that for
> absolute paths each ".." in the relative path
> strips off a level of the directory.
> 
> I don't know of a function which does specifically
> what you ask, but the above basically outlines
> the functionality required to code it yourself.
> 
> If you actually wanted to find the physical interface
> of the file (the "drive"), once you have gotten the
> absolute path, you can search for a match in
> the /etc/fstab to find what is mounted at that
> location.  But, I don't think this is what you're
> looking for.  :-)

Nope.

> 
> Hope this helps!
> 
> 

Sure does. Thanks a bunch Patrick.

Joseph Martin
[EMAIL PROTECTED]

Reply via email to