Re: split a /path/filename into components



Eric wrote:

Is there a C library function that can take a path and break it into its
component parts? I think dos has one called fnsplit but i cant seem to
find an equal in the linux world

I'm working with Python mostly lately, so memory isn't fresh...

But wasn't there a strtok() function in C, that would split a string, based
on a given char ? Us '/' as that char, and you should be fine.



--
Research is what I'm doing, when I don't know what I'm doing.
(von Braun)

.



Relevant Pages

  • Re: setlocale howto
    ... AVE>>Since such codepoints are not defined for KOI8-R, ... But why this example works on Linux without type conversions? ... "Linux" does not have unsigned char by default. ...
    (freebsd-stable)
  • Re: xor: how come so slow?
    ... never do things like this with python. ... I'm trying to encode a byte data. ... I cycle on the two strings to be xor-red ... in char (chr) ...
    (comp.lang.python)
  • Re: Newbie NameError problem
    ... for char in line: ... Remember that in Python, ... of the Loc class object, and so are shared by all instances. ... This defines two local variables line and char, ...
    (comp.lang.python)
  • Re: QT, ctypes dll and SEG Faults
    ... The crash can occur because you pass a char* to your library. ... char* is not managed by your library but by Python. ... filename with a hard coded value it doesn't crash. ...
    (comp.lang.python)
  • Re: h2py.py bug?
    ... I mean if you define a char literal then in python you would have used a string value: ... Yes, true, but if you intend to use it as an integer, wouldn't you use a numeric value instead of a character literal? ...
    (comp.lang.python)