Wrox Programmer Forums
BOOK: Professional Visual Basic 2008 ISBN: 978-0-470-19136-1
This is the forum to discuss the Wrox book Professional Visual Basic 2008 by Bill Evjen, Billy Hollis, Bill Sheldon, Kent Sharkey; ISBN: 9780470191361
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Visual Basic 2008 ISBN: 978-0-470-19136-1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 31st, 2009, 02:29 PM
Registered User
Join Date: Jul 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 31 FTPClient

The FTPClient example in chapter 31 has 2 functions that call getDirectoryEntries(), GetDirectories() and GetFiles.

Each supplies a "directoryattribute" character which helps the called function distinguish FTP listing entries as either directories ("d") or files ("-").

Comments indicate that each line of the FTP directory listings received by the called function will either begin with "dx-xr-xr-x" or "-x-xr-xr-x" respectively. If the called function GetDirectoryEntries receives a directoryattribute of "d" from the calling function, it will return only entries containing dx-xr...., and if the received directoryattribute is "-", it will only return those directory entry lines beginning -x-xr...

Using VS2008 and a XP based FTP server I built the test example and I had some difficulty until I put some console.writelines in and found that the XP FTP server does not return the directory entries in the specified format. For a root directory that has one sub-directory and one text file, my XP based FTP server returns

07-30-09 04:06PM <DIR> New Folder
07-31-09 02:20PM 35 New Text Document.txt

Is this a .Net 2 vs 3.5 thing, or is it a Microsoft vs the world FTP thing?

I tested this against a Windows 2000 SP4 Server and got the same format returned.

If it is an MS thing then the app I am building will have to test for both format types.

Old August 3rd, 2009, 06:31 PM
Wrox Author
Join Date: Jun 2007
Posts: 16
Thanks: 1
Thanked 1 Time in 1 Post

Hi Tom,

Offhand, I'd think it was the server not sending back the right data, as that code worked with the Server 2003 FTP server (using 3.5) as well as a couple of Unix servers I tested. Let me install the XP server and try it again here.

UPDATED: OOOOkay, time to eat my words. Or something. Even the Unix boxes I'm connecting to are now returning something different now:
<TITLE>FTP directory: /</TITLE>
<BASE HREF="ftp://anonymous:me@here.comom@ftp.cc.umanitoba.ca/">
<H1>Current directory is /</H1>
Please read the file NOTICE
230-  it was last modified on Fri May 14 18:54:06 1993 - 5921 days ago
[DIRECTORY]  <A HREF="E/">E</A>. . . . . . . . . . . . . . . . . . . .    [Feb 19 19:27]
[FILE]       <A HREF="NOTICE">NOTICE</A> . . . . . . . . . . . . . . . . .    [May 14  1993]    515B
[FILE]       <A HREF="SITEINFO.AFA">SITEINFO.AFA</A> . . . . . . . . . . . . . .    [Dec 15  1993]      1K

Which of course is different still from what you were seeing. Joyous.

Do you get the same format on your 2000 server, or the format you see on your XP box?
TTFN - Kent

Last edited by ksharkey; August 3rd, 2009 at 07:17 PM.. Reason: updated answer
Old August 3rd, 2009, 07:28 PM
Wrox Author
Join Date: Jun 2007
Posts: 16
Thanks: 1
Thanked 1 Time in 1 Post

Hi Tom,

Something for you or your admin to check on the config of the FTP service. Is the format set to Unix-style or MS-DOS-style? (On Home Directory tab)
TTFN - Kent

Similar Threads
Thread Thread Starter Forum Replies Last Post
system error 31 (MS Access) EricTheViking Access ASP 2 January 14th, 2008 04:40 PM
Wrox 50% off eBooks sale through Oct 31, 2007 jminatel Forum and Wrox.com Feedback 0 September 14th, 2007 03:22 PM
C# version: Pg 31-32 error Noisy Crow BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 November 10th, 2006 06:31 AM
Where's download code in ISBN:<1-861005-31-8>? ZhangXuan VS.NET 2002/2003 0 July 19th, 2004 02:40 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.