Page 2 of 2
Re: GetExtensionPart() of empty filename
Posted: Mon Jun 03, 2024 9:13 pm
by Michael Vogel
NicTheQuick wrote: Mon Jun 03, 2024 5:44 pm
I don't accept that as a definition.
I didn't and you don't need either.
There are different approaches you can find your personal answer, my starting perspective is the file system used by DOS 1.0 (SFN) which is well defined - but doesn't give us a final answer (one dot is allowed and everything after that is an extension... but an empty file name part isn't permitted).
Would be interesting which 8.3 name gets stored as a FAT entry when creating a .htaccess file (could be also checked using something like echo %~s1).
Re: GetExtensionPart() of empty filename
Posted: Mon Jun 03, 2024 10:11 pm
by BarryG
Kwai chang caine wrote: Mon Jun 03, 2024 12:35 pmYour code not works for me :
Debug GetFileExtension("X:\A\A\B\A\B\GTI\A\.tproject") ; ""
return nothing, then ".tproject" is yet good an extension of IDE TIZEN project
Well, if there's no file part, then what's left cannot logically be an extension. An extension, by definition, needs a file part to extend from.
Re: GetExtensionPart() of empty filename
Posted: Tue Jun 04, 2024 11:59 am
by RASHAD
Code: Select all
filename$ = "X:\A\A\B\A\B\GTI\A\.tproject"
If GetFilePart(filename$) = GetFilePart(filename$,#PB_FileSystem_NoExtension)
Debug "No Extension part"
Else
Debug GetExtensionPart(filename$)
EndIf