How to get filename from path, with or without _splitpath?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi all.

I need to get filename and extension from a path. _splitpath seems to
be good for that, you would think that MS knows the rules of paths and
filenames. But MSDN warns about buffer over runs in splitpath
documentation.

Should I check for maximum pathlenght or what?

So is there any rules?

Or do I just search for last "\" for filename and last "." for
extension?

.



Relevant Pages

  • String code required please
    ... Does someone have the Python code to pull just the filename and ... extension from the end of an absolute path please. ... Prev by Date: ...
    (comp.lang.python)
  • Re: How to get filename from path, with or without _splitpath?
    ... For those users not using .NET, where can we find the source code for ... I too would like to rid my code of _splitpath. ... >> I need to get filename and extension from a path. ...
    (microsoft.public.vc.language)
  • Re: Random filenames
    ... >> extension must remain the same for each filename returned. ... You still need to change the extension than, iirc there is a changeextension ... Prev by Date: ...
    (comp.lang.pascal.misc)
  • Re: Filename as Data
    ... that just says "insert the filename without the extension as text here" ... "Tom Ogilvy" wrote: ... Prev by Date: ...
    (microsoft.public.excel.programming)
  • Re: Random filenames
    ... > extension must remain the same for each filename returned. ... > different platforms. ... Prev by Date: ...
    (comp.lang.pascal.misc)