Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper format to read FTP directory
Message
From
10/05/2012 09:06:13
 
 
To
10/05/2012 02:54:25
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01543372
Message ID:
01543409
Views:
27
>We know that all components are separated by one ore more spaces
>I capture the parts between the spaces into named groups ( see http://msdn.microsoft.com/en-us/library/az24scfc.aspx under Grouping Constructs )
>
>After the month and the day, you have either a year or a time
>This part of the pattern
>
>((?<Year>\d{4})|(?<Time>\d+:\d+(:\d+)?))
>
looks for 4 digits (year) or a time. The vertical bar is an alternation (or)
>
>The nice thing about using this is that (1) I do not have to count spaces and (2) I can modify the pattern with minimal changes to the code
>
>
>The output for this line
>
>-r-xr-xr-x   1 owner    group            4737 Jan 18 13:50 4A17A7B1.txt
>
>is 
>
>Month Jan
>Day 18
>Year
>Time 13:50
>Size 4737
>FileName 4A17A7B1.txt
>
>
>and the output for
>
>-r-xr-xr-x   1 owner    group            4737 May  5  2011 4A16PBE1.txt
>
>is
>
>Month May
>Day 5
>Year 2011
>Time
>Size 4737
>FileName 4A16PBE1.txt
>
>
>So, you can simply test whether you have a year ( or a time )

Thanks

So, basically, as far as FTP directory listing, is it about the format we can expect or there could other weird formats returned by some FTP servers?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform