Samba lessons needed
bobwarren at howsoft.com
Wed Feb 21 14:18:11 EST 2007
Knock-knock! Anybody there? I think that all the people who might be
able to give me some suggestions about solving my problem were away at
the Brazilian carnival a day or two back, so I'll ask my question again:
If I want a directory of my home network, I can type the following into
my Ubuntu terminal:
It asks for a password, but this can be null.
To do the same thing in Rev, I do this:
open process "/usr/bin/smbtree" for read
read from process "/usr/bin/smbtree" until eof
put it into field "test"
close process "/usr/bin/smbtree"
Works like a charm, and doesn't even ask for a password.
Now I want to get the directory of my Windows computer's drive C:\ over
the network (the name of the computer is "john").
In the Ubuntu terminal, the following works perfectly and I get a
listing of my Windows drive:
smbclient \\\\john\\c mount
(CTRL+Z exits Samba)
Now here's where I fall flat on my face. I have tried this and a
thousand other variations in Revolution:
put "/usr/bin/smbclient \\\\john\\c mount" into procToDo
[I have also tried this for example:
put "smbclient\ \\\\john\\c\ mount" into procToDo]
open process procToDo for update
write "dir" to process procToDo [or "dir" & return]
read from process procToDo until eof
put it into field "test"
close process procToDo
*** Might it need a simulation of the operator's CTRL+Z here? How do you
do that in Rev? But "quit" works in the terminal too, and I have tried:
write "quit" to process procToDo
However, it seems that the CTRL+Z or QUIT is not the problem. Samba is
not finding my Windows server. The problem appears to be in the first line.
(Or could it have something to do with supply of a root password -
possibly necessary when not using the terminal itself - that does not
appear explicitly? Note the inconsistent behaviour between terminal
usage and the Rev process call in the first successful example. In this
case, any password - including empty[ENTER] - was acceptable at the
terminal. Or could it have something to do with the fact that Samba,
once activated, kicks into its own mode that is causing problems in
data retrieval through Rev? Before Samba's activation at the terminal, I
get "bob at bob-desktop:~$" as a prompt. After, I get "smb: \>".)
A person with this kind of experience can perhaps give me a tip, but if
not, even daft suggestions from outsiders can sometimes provoke the
"aha" flash of illumination I am looking for.
More information about the Use-livecode