newguy
Well-known member
I am using FTP and using the ListDirectoryDetails method - in the ResponseString I get back <DIR> for the files so when I parse my FTPFileInfo class for the returned values these show up as directories and not files. This is the parser:
Here's the result output string
What I have found is a diff format altogether :
-rw-rw-rw user1 group 4387 Nov 12 12:20 default.asp <-file
drw-rw-rw user1 group 4387 Nov 12 12:20 Admin <-directory
So here I would just check the first character for 'd' or '-'.
So why do I get such a diff format. The server is windows not unix - which is similar to above.
VB.NET:
Sub New(ByVal line As String, ByVal path As String)
'parse line
Dim m As Match = GetMatchingRegex(line)
If m Is Nothing Then
'failed
Throw New ApplicationException("Unable to parse line: " & line)
Else
_filename = m.Groups("name").Value
_path = path
_permission = m.Groups("permission").Value
Dim _dir As String = m.Groups("dir").Value
If (_dir <> "" And _dir <> "-") Then [COLOR="Red"]'<- is this part right?[/COLOR]
_fileType = DirectoryEntryTypes.Directory
Else
_fileType = DirectoryEntryTypes.File
End If
Try
_fileDateTime = Date.Parse(m.Groups("timestamp").Value)
Catch ex As Exception
_fileDateTime = Nothing
End Try
End If
End Sub
Here's the result output string
HTML:
10-12-09 12:04PM <DIR> filename
What I have found is a diff format altogether :
-rw-rw-rw user1 group 4387 Nov 12 12:20 default.asp <-file
drw-rw-rw user1 group 4387 Nov 12 12:20 Admin <-directory
So here I would just check the first character for 'd' or '-'.
So why do I get such a diff format. The server is windows not unix - which is similar to above.
Last edited: