Automatic Filename Extensions
loafman at convex.UUCP
loafman at convex.UUCP
Wed Apr 13 01:32:00 AEST 1988
/* Written 9:47 am Apr 11, 1988 by davidsen at 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
--------------------------------------------------------
More information about the Comp.lang.c
mailing list