On Mon, 5 Oct 1998, Herry Budiutama wrote:

-On Mon, 5 Oct 1998, Ibrahim F Haddad wrote:
-
-> I need to check whether the file is of extension xyz (i.e. name.xyz).
-> I determine the lenght of the fileName (strlen(fileName)). 
-> How can i then check if the last 4 characters are .xyz in a neat
-> way. Cause if they're not i will return a warning message.

don't forget that UNIX filenames don't have to have 3 letter extensions...
also they're not also 3 letters long (/etc/hosts, foo.c, index.html, 
bar.tar.gz etc...) so you'd have to check this too... Also, dots are used
in files instead of spaces : this.file.is.long-V3.0a.tgz.

-- 
+++ Divide By Cucumber Error, Please Re-Install Universe And Reboot +++
[EMAIL PROTECTED]                    http://x-map.home.ml.org

Reply via email to