Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!hplabs!sdcrdcf!otto!convex!authorplaceholder From: loafman@convex.UUCP Newsgroups: comp.lang.c Subject: Re: Automatic Filename Extensions Message-ID: <64400007@convex> Date: 12 Apr 88 15:32:00 GMT References: <787@srs.UUCP> Lines: 23 Nf-ID: #R:srs.UUCP:-78700:convex:64400007:000:1054 Nf-From: convex.UUCP!loafman Apr 12 10:32:00 1988 /* Written 9:47 am Apr 11, 1988 by davidsen@steinmetz.Sun.COM */ [...] in UNIX that's fine, a name like a.b may have .EXT added, but it won't work on other systems, such as MSDOS and VMS. How about isolating just the filename via strrchr (or rindex) and then using strchr as you have been. Something like: [...] /* End of text from convex:comp.lang.c */ Actually MSDOS is a little more perverted than you have illustrated, i.e. the name: d:\bin\glarp.20 may be a filename _or_ a directory. The only way to tell for sure is to use something along the lines of an access() call to check it. I've found no syntax yet that will guarantee what that name means. -------------------------------------------------------- Kenneth W. Loafman @ Convex Computer Corp, Dallas, Texas USPSnail: 701 North Plano Rd, Richardson TX 75083-3851 UUCP: {allegra,ihnp4,uiucdcs,ctvax}!convex!loafman CompuServe: 72345,233 Phone: (214) 952-0829 Disclaimer: opinion->loafman != opinion->convex --------------------------------------------------------