ListItems Event - Parsing FileInfo - WeOnlyDo Discussion board

ListItems Event - Parsing FileInfo (wodFtpDLX / wodFtpDLX.NET)

by goondoo27, Tuesday, August 17, 2004, 19:46 (7182 days ago)

How can I parse out the FileInfo string? I need a way to put the filename, size, date/time, and dir/file information into variables. When I connect to different FTP servers I get different patterns for the FileInfo variable.

Here's 2 examples from FTP servers that I connect to.

Example #1:

total 75688
drwxrw-rw- 1 root root 0 Mar 30 16:12 .
drwxrw-rw- 1 root root 0 Mar 30 16:12 ..
-rwxrw-rw- 1 root root 51 Mar 3 21:17 CUSTDATA.INI
-rwxrw-rw- 1 root root 1871858 Oct 1 2003 DDS_Files.zip
-rwxrw-rw- 1 root root 21409642 Mar 3 20:55 New_installs.zip
dr-xr--r-- 1 root root 0 Aug 18 2003 WIN


Example #2:

03-29-04 05:44PM <DIR> _borders
03-29-04 05:46PM <DIR> _derived
03-29-04 05:44PM <DIR> _private
03-29-04 05:37PM <DIR> _vti_txt
03-29-04 05:46PM 13304 AboutUs.htm
03-29-04 05:37PM <DIR> AboutUs_files
03-29-04 05:46PM 28918 Applications.htm
03-29-04 05:46PM 24888 CableA11100.htm
03-29-04 05:46PM 21401 CableA12600.htm


As you can see the formats are completely different. Example #1 even includes a total line that isn't a file or directory. To make matters worse, for Example #1 I have to send the remotepath property with a prepended slash / , but for Example #2 the directory listing fails if a slash / is prepended.

I hope you have an easy solution to all of this.

Thanks,
John


Complete thread: