[Gambas-user] Class File
Benoît Minisini
gambas at ...1...
Sun Mar 16 13:45:06 CET 2003
Le Mardi 11 Mars 2003 21:52, Charlie a écrit :
> Salut Benoit,
>
> useing File.Ext or File.BaseName on a doupple doted Extention.
>
> take ..\..\myProject.tar.gz
> File.BaseName = myProject.tar
> File.Ext = gz
> so
> txtFile.text = File.BaseName(Dialog.Path)
> lblExt.text = File.Ext(Dialog.Path)
> from a Dialog.SaveFile() gives back wrong results
>
> workround
>
> txtFile.text = file.Name(Dialog.Path)
> IF Instr(txtFile.text,".") > 0 THEN
> lblExt.text = Mid$(txtFile.text,Instr(txtFile.text,"."))
> txtFile.text = Replace(txtFile.text,lblExt.text,"")
> ELSE
> lblExt.text = ""
> END IF
>
> amicalement
> Charlie
>
>
Mmm... The file extension is really what stands after the last point. The
extension of foo.tar.gz is "gz". I think that File.BaseName and File.Ext are
correct, and that your problem is a specific case due to the way how 'tar'
and 'gzip' work together.
Regards,
--
Benoît Minisini
mailto:gambas at ...1...
More information about the User
mailing list