>Hi, Buddies
Hey!
>I want to use ftp via ftpLib with account and password in vxWorks. How
>can I implement this?
Begin by reading Chapter 8, Remote Access Applications, of the VxWorks
Network Programmer's Guide and the ftpLib and ftpLib API emtries in the
VxWorks OS Libraries Api Reference.
IOW, RTFM!
>Thanks!
HTH
--
========================================================================
Michael Kesti | "And like, one and one don't make
| two, one and one make one."
mrkesti at comcast dot net | - The Who, Bargain
The issue I encountered is:
I want to use ftp to transfer some files from target board to a ftp
server.
o If I use the current board as the ftp server, the files can be
transfered correctly.
o But if an external ftp server, such as server in my pc, was used, it
can't work.
Personally, I guess the issue may not lies in the FTP itself, because
its a widely used protocol. How to debug the root cause in VxWorks?
Any firewall in my pc may cause this issue. I can't disable the
firewall, because I am in the office.
Any suggestions are welcome. Thanks!
<wizard-of-oz>
Oh! Well, why didn't you say so in the first place?
</wizard-of-oz>
>Any suggestions are welcome. Thanks!
I had a similar problem with my most recent client's project. One of
the client's people soved it on their server's end, though, and I cannot
recall what was the issue. Something to do with the size of a request,
I think, but I'm really not sure. Perhaps this will be enough of a clue
to help you, I hope.
Suggestions are welcome. Thanks!
The server might provide a logging facility that you can use to obtain
more info, otherwise your best bet is probably to use a network sniffer
to observe the traffic and see what the server is actually sending, if
anything.
The issue seems error occured when we write(maybe create) a new file in
server.
--
BaSystem Martin Raabe
E: Martin.Raabe<at>B-a-S-y-s-t-e-m<dot>de
jeanwelly schrieb:
So this means that you can do the exact same commands from PC and PPC on
the correct accounts and you can't do the STOR command on the uncorrect
accounts?
I want to ftp a file from a remote FTP server (my PC) to a board
running VXWORKS.
I have a function that calls ftpXfer as follows,
if ( ftpXfer ( "172.25.21.44", "anonymous", "password", "", "RETR
%s", "C", "abc.txt", &hControlSocket, &hDataSocket ) == ERROR )
{
printf ("\nSome error in ftp\n");
xfererror = TRUE;
}
else
printf ("\nNo error in first part\n");
if ( ( hControlSocket == -1 ) || ( hDataSocket == -1 ) )
{
printf ("\nSome socket is -1\n");
xfererror = TRUE;
}
if (TRUE == xfererror )
printf ("\nERROR\n");
else
printf ("\nNO ERROR\n");
Occassionaly, I see the print Some error in ftp, whereas at most other
times I get NO ERROR.
However, if I ftp to the board, I find the file abc.txt missing (even
in the NO ERROR case)
Can anyone help?
Thanks for your time...
Issue is solved
I assumed that ftpXfer would transfer the file onto flash for me...
gotta use the hDataSocket instead to do a read
Pseudo code that works:
if ( ftpXfer ( "172.25.21.44", "anonymous", "password", "", "RETR
%s", "C", "abc.txt", &hControlSocket, &hDataSocket ) == ERROR )
{
printf ("\nSome error ...
:
:
:
if (TRUE == xfererror )
printf ("\nERROR\n");
else
printf ("\nNO ERROR\n");
// newly added code:
// check if there was an error in starting the transfer... If not,
while ((num = read (hDataSocket, buf, sizeof (buf))) > 0)
{
retval = fputs (buf, fp); // buf is the fd of the file of name abc.txt
created in flash
}
// close fp, hControlSocket and hDataSocket
Do let me know if you spot a flaw or know how to do this better.
Thanks...