Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 2206  / 1 Year ago, sun, may 14, 2023, 2:47:39

I am checking the filename validity on Ubuntu computers. I want to check whether the file extension is correct.



  • If the only valid dot is the one before the file extension, then this check is valid:


    example.endexample -> file extension is endexample


  • But if a dot is allowed in the filename, then this check is invalid:


    example.continue.endexample -> file extension is continue.endexample



So is separating the value after the first dot in order to get the file extension enough?


More From » files

 Answers
1

This is very easy to answer: Yes, dots are allowed everywhere in Linux filenames. Even "worse": Linux and Unix filenames don't necessarily have extensions expressed in the name of the file.


So you will probably find many "incorrect" or missing file extensions, since there are no rules for filename extensions as in Microsoft's systems.


You can find the general rules here: Linux / UNIX: Rules For Naming File And Directory Names


[#3535] Monday, May 15, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
iedncommon

Total Points: 200
Total Questions: 95
Total Answers: 132

Location: Tonga
Member since Mon, Aug 2, 2021
3 Years ago
iedncommon questions
Sat, Jun 4, 22, 18:20, 2 Years ago
Mon, Apr 4, 22, 08:10, 2 Years ago
Tue, Jul 6, 21, 15:11, 3 Years ago
;