Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 31st, 2009, 03: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.

Tom
  #2 (permalink)  
Old August 3rd, 2009, 07:31 PM
Wrox Author
Points: 61, Level: 1
Points: 61, Level: 1 Points: 61, Level: 1 Points: 61, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: Comox, BC, Canada.
Posts: 16
Thanks: 1
Thanked 1 Time in 1 Post
Default

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:
Code:
<HEAD>
<TITLE>FTP directory: /</TITLE>
<BASE HREF="ftp://anonymous:me@here.comom@ftp.cc.umanitoba.ca/">
</HEAD>
<H1>Current directory is /</H1>
<PRE>
<HR>
Please read the file NOTICE
230-  it was last modified on Fri May 14 18:54:06 1993 - 5921 days ago
<HR>
[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 08:17 PM. Reason: updated answer
  #3 (permalink)  
Old August 3rd, 2009, 08:28 PM
Wrox Author
Points: 61, Level: 1
Points: 61, Level: 1 Points: 61, Level: 1 Points: 61, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: Comox, BC, Canada.
Posts: 16
Thanks: 1
Thanked 1 Time in 1 Post
Default

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
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 04: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 03:40 AM



All times are GMT -4. The time now is 12:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.