View Single Post
Old 07-06-2024, 10:59 AM   #98
nabsltd
Fanatic
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 528
Karma: 9529956
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
Quote:
Originally Posted by KevinH View Post
FWIW, using the file extension helps prevent name collisions but I really hate seeing the "." as part of an identifier. I think it would be better to split off the extension and then add it back to the end of the filename prepended with an underscore and not a period.

So Cover.jpg as an id would become Cover_jpg
Because spaces (and possibly other characters) in the filename are already converted to underscores, it's possible that unique filenames could—in theory—create non-unique IDs. Depending on what characters currently get replaced with underscores, you could get a collision. In particular, if you globally replace periods with underscores (and not just the extension separator), then a very common naming scheme will cause collisons:
Code:
A.Long.Filename.jpeg
A Long Filename.jpeg
So, other than being mindful of ID collision, I agree that converting the period would be a good idea.
nabsltd is offline   Reply With Quote