PDA

View Full Version : Filename case sensitiity (Win/Linux)


aperry
7th of October 2007 (Sun), 20:52
Hi all,

I have an EE site that's been ported from Linux to Windows. The porting process was relatively smooth (copied files, backed up and restored DB, and updated paths), but recently I've added some more pictures and noticed some odd behavior.

Some pictures in the galleries seem to be "missing", meaning I can see their label in the gallery but no images (thumbnails and sizes are "blank"). Upon further investigation I noticed that in each case the URL for the image is looking for a ".JPG", whereas the actual filename is ".jpg". Of course, when I change the filenames to the appropriate "case" everything is fine. However, I looked in the MySQL tables and noticed that for these particular images there seem to be two entries in the DB (one for the uppercase extension, and one for the lowercase extension). So in the situation where I add files test.jpg and test.JPG, EE is treating them as two separate non-duplicate files but it seems that they're overwriting each other in the photos directory since it's Windows and therefor not case sensitive.

Anyway, I had thought EE was pretty good at locating and changing duplicate filenames as they're added. Is it possible that it has trouble with duplicates that have different case extensions when running in Windows? Or is there something obvious (like a setting) that I'm overlooking?

Thanks!
Aaron

Pekka
9th of October 2007 (Tue), 09:38
The problem is that Windows filesystem is not case-sensitive. And while Linux is, the symptom after porting gallery to Windows is exactly like you describe. Windows can not hold "file.jpg" and file.JPG" in same directory, so the only choice is to rename duplicate and use photo editor to reselect the new named file (or just type in in there).

aperry
10th of October 2007 (Wed), 15:59
Hi Pekka,

Thanks for the reply! Quick question: is this only a problem when porting from Linux to Windows, or is it also a problem with a new Windows install?

In other words, if I install EE and build a new gallery in Windows and I add "test.JPG" and then later I add "test.jpg" will EE detect the filename match and automatically rename the file, or will I run into the same overwrite issue?

Thanks!
Aaron

Pekka
11th of October 2007 (Thu), 15:17
EE with normally detect duplicate file names are rename them when uploading. Apparently I did not think case sensitivity when coding that checker so that is one more thing to add in todo list :o

aperry
11th of October 2007 (Thu), 20:41
Cool, thanks again for the reply!

Aaron