6

I have a python application (deployed on centos) which searches for files in a shared path on (windows) the windows paths named like below (upper and lower case) \\shared\PDFs\MyFolder\SomeFile.txt yet, the user input is in lower case \\shared\pdfs\myfolder\somefile.txt so when I try to search that on centos, I get file doesn't exist, is there away to make centos files accessible in insensitive way ?

1 Answer 1

5

If you've mounted the remote SMB/CIFS filesystem you can use the nocase mount option. For example, in your /etc/fstab, do:

\\192.168.1.247\sharename          /mnt/location                cifs    auto,credentials=/root/credentials_file,vers=2.0,nocase 0 0

Note the nocase option at the end.

Look what happens if you use the nocase option:

/mnt/location» ls -la
drwxr-xr-x. 2 apache apache    0 Apr  4  2018 __skel
/mnt/location» cd __SKEL # note uppercase, while the dir itself is lowercase
/mnt/location/__SKEL» # hey that worked

You may check the man page for more mount options: https://linux.die.net/man/8/mount.cifs

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .