I'm trying to read a file on a samba mount point. I can list the file, and I can stat
the file. But I can't open it without unless I have the correct file name case. Unfortunately, I can't programmatically determine the file name case (short of listing the directory, which is too slow).
$ ls /mnt/windows_share/file001.txt
/mnt/windows_share/file001.txt
$ stat /mnt/windows_share/file001.txt
File: '/mnt/windows_share/file001.txt'
Size: 9203221 Blocks: 18432 IO Block: 16384 regular file
Device: 11h/17d Inode: 1239685 Links: 1
Access: (0766/-rwxrw-rw-) Uid: (65536/ UNKNOWN) Gid: ( 1/ daemon)
Access: 2010-10-27 10:01:25.433832000 +0000
Modify: 2010-10-27 10:01:25.433832000 +0000
Change: 2010-10-27 10:01:25.433845200 +0000
$ cat /mnt/windows_share/file001.txt > /dev/null
cat: /mnt/windows_share/file001.txt: No such file or directory
I initially thought this was a python problem, but the equivalent operations from the shell don't work either. I'm clearly missing something.
Relevant /etc/fstab
line (this behavior is the same with or without the nocase
option):
//192.168.1.2/share /mnt/windows_share/ cifs ro,nocase,username=xxx,password=. 0 0