[Done]GetExtensionPart() of empty filename

Found an issue in the documentation ? Please report it here !

Moderator: Documentation Editors

User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: GetExtensionPart() of empty filename

Post 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. :wink:

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).
BarryG
Addict
Addict
Posts: 4127
Joined: Thu Apr 18, 2019 8:17 am

Re: GetExtensionPart() of empty filename

Post 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 :wink:
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.
Last edited by BarryG on Tue Jun 04, 2024 12:10 pm, edited 2 times in total.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4946
Joined: Sun Apr 12, 2009 6:27 am

Re: GetExtensionPart() of empty filename

Post 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
Egypt my love
Post Reply