Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Sort of can't see file over SAMBA share
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Fri Nov 14, 2003 10:34 pm    Post subject: Sort of can't see file over SAMBA share Reply with quote

Hi all,

I have a webserver which is a gentoo box. It has a page which (via PHP) lists the files in a directory on my windows box which is mounted via samba (2.2.8a). When I just list the files everything works fine. However, when I try to retrieve additional information about the file (last modified time and size) I get errors like this:

Code:
Warning: filemtime(): Stat failed for files/Fool's Garden - Lemon Tree.doc (errno=2 - No such file or directory) in /home/httpd/site/functions.php on line 59


I'm positive the file is there. In fact if I don't try to get the modified time or size it displays the file name without a problem. I can telnet and do an 'ls' on the directory and see the file. However, if I try to type the file name like 'ls Fool's Garden - Lemon Tree.doc' I get:

Code:
ls: Fool's Garden - Lemon Tree.doc: No such file or directory


Any ideas?

Thanks,
P
Back to top
View user's profile Send private message
taskara
Advocate
Advocate


Joined: 10 Apr 2002
Posts: 3763
Location: Australia

PostPosted: Fri Nov 14, 2003 11:04 pm    Post subject: Reply with quote

oh that is weird.


what happens if you mount the samba share manually to a local mount point? can you check file details there?

if so it's perhaps something wrong with your php script?

and if not.. then we shoot samba
_________________
Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!
Back to top
View user's profile Send private message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Fri Nov 14, 2003 11:10 pm    Post subject: Reply with quote

yeah - this is all with a manual samba mount - Now I need to shoot samba?

-P
Back to top
View user's profile Send private message
taskara
Advocate
Advocate


Joined: 10 Apr 2002
Posts: 3763
Location: Australia

PostPosted: Fri Nov 14, 2003 11:11 pm    Post subject: Reply with quote

hmmm...

so even mounting samba manually and checking for files does not work?

what about from a windows box?
_________________
Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!
Back to top
View user's profile Send private message
imeridian
n00b
n00b


Joined: 12 Nov 2003
Posts: 67

PostPosted: Sat Nov 15, 2003 10:32 am    Post subject: Reply with quote

I'd say it's a problem relating to the spaces in the filename and thus related to a 'problem' with the php script. In my experience whenever there's a space in a filename (and this may apply to the other 'non-standard' characters like the apostrophe) that space needs to be escaped when dealt with on the command line. With TAB completion it should show the spaces escaped (and other problematic characters).
Back to top
View user's profile Send private message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Sun Nov 16, 2003 3:53 am    Post subject: Reply with quote

Hey all,

Thanks for the responses. So, it's definately not due to escaping characters because all of my files have spaces in their names and many have apostrophes - and I've been pretty careful about that kind of stuff. However, when I got home tonight I looked at the filename in windows explorer and it was: "Fool´s Garden - Lemon Tree.doc" - Notice that the apostrophe isn't really an aposotrophe but some weird character I can't even find on my keyboard.

So my new theory is that windows has some extended character set that samba doesn't support. Is that possible? The even weirder thing is that now that I am at home, when I go to view my page, it gives the correct size and last modified time - with no errors?!?!

Any ideas? Thanks again for your help,
P
Back to top
View user's profile Send private message
fleed
l33t
l33t


Joined: 28 Aug 2002
Posts: 756
Location: London

PostPosted: Sun Nov 16, 2003 11:22 am    Post subject: Reply with quote

You probably have a code page mismatch. I've had sooooo much grief with that. Make sure you're using the same codepage on all machines.
Back to top
View user's profile Send private message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Sun Nov 16, 2003 2:46 pm    Post subject: Reply with quote

Thanks! What is a code page? How do I check that they're mismatched?
Back to top
View user's profile Send private message
fleed
l33t
l33t


Joined: 28 Aug 2002
Posts: 756
Location: London

PostPosted: Sun Nov 16, 2003 4:29 pm    Post subject: Reply with quote

Codepage is what maps characters to numbers. Eg, 32 is space, etc. It's usually a problem only if you use accented characters (á ë ù, for eg) or some symbols.

According to samba docs (man smb.conf then look for codepage) you can check the windows codepage by typing chcp in a dos window. Try that and see if it matches what you have on your samba server. If you have nothing set in smb.conf then I think it uses 850.

Hope that helps!
Back to top
View user's profile Send private message
imeridian
n00b
n00b


Joined: 12 Nov 2003
Posts: 67

PostPosted: Mon Nov 17, 2003 6:06 am    Post subject: Reply with quote

I'm actually having the same problem now [that I installed gentoo on my file server].

Whenever I try to work with files on mounted shares I get "file not found" errors.

I tried setting samba on the server to use codepage 437 via this in the global portion:
client code page = 437

and put codepage=cp437 as one of the options in the fstab entry of the client, but it doesn't seem to help at all.

To make matters worse after one of those errors it's causing the mount on the client to come back as busy so it can't be unmounted. :(


UPDATE: I think running FAM is the problem. I found this post: https://forums.gentoo.org/viewtopic.php?t=73786&highlight=samba+file and although it received no replies I stopped FAM and sure enough things started working properly in the "file not found" problem.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum