01-19-2007 01:10 AM
01-19-2007 09:25 AM
What version of CVI are you using?
What FTP server are you using?
How are you declaring the dir variable?
There's an earlier message about problems with InetFTPGetDir that didn't seem to get resolved. http://forums.ni.com/ni/board/message?board.id=180&message.id=24006&query.id=223193#M24006
01-19-2007 06:07 PM
01-19-2007 06:52 PM
Hello Cheers,
I am using CVI 8.0.1 example ftpclnt in the directory CVI80\Samples\Internet\ftpclnt. The FTP server is VxWorks
The function InetFTPGetDir returned 0 (no error), but I got back an incomplete dir string. The traffic monitor program Ethereal does indicate that the server sent a complete string.
CVI string return was truncated as urrent directory is instead of Current directory is "/RAMDEV0/. Please see attached capture file.
Best Regards,
Ton Ng
01-20-2007 07:54 AM
Hypothesis: InetFTPGetDir() works by trying to parse the string returned by an FTP 'pwd' command in a farly simple way.
With a typical GNU/Linux FTP server, the string returned is like this:
"/" is current directory.
and you can see that if you remove the first character and copy everything up to the next double quote, you get the directory /.
However, applying the same algorithm to the string the the VxWorks FTP server returns:
Current directory is "/RAMDEV0/
would get you exactly what you are seeing.
Which would suggest that InetFTPGetDir will only work properly with FTP servers that act like the GNU/Linux one. Which isn't ever so useful for the other servers.
01-22-2007 09:22 AM
The format returned by the VxWorks server does not obey the FTP RFC 959. Check out http://www.faqs.org/rfcs/rfc959.html. The response to PWD is supposed to be in the same format as the response to MKD, which should be of the form:
257<space>"<directory-name>"<space><commentary>