Re: [Dev-C++] ANSI C: How to split path and filename
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Luigi S. <gi...@li...> - 2001-06-08 01:29:13
|
I hope that you'll find the attached files of some help. I suggest that upon splitting the name of the file, the separator is not=20 discarded, instead it is kept as the last char of the path: doing so allows= =20 you to rebuild the name of the file by joining what has been returned by= =20 "thepath" (as long as it is not NULL) and what has been returned by=20 "thefile" regardless of which is the separator (i.e. a backslash, a colon=20 or a slash). At 10.50 07/06/01 +0200, you wrote: >Hello, >how do I split my path and my filename? >Example: > >c:\things\alfa\myfile.txt > >like: char *thepath ----> c:\things\alfa > char *thefile ----> myfile.txt > >in ANSI C (or C), meaning the same way with DOS or UNIX > >There is anywhere to find this kind of things? (I couldn't find in the help >neither in Bob Stout's snippets) > >Thanks. > >_______________________________________________________________ >Do You Yahoo!? >Yahoo! Messenger: Comunicaci=F3n instant=E1nea gratis con tu gente - >http://messenger.yahoo.es > >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >http://lists.sourceforge.net/lists/listinfo/dev-cpp-users -- gisan |