ComponentSpace FTP Class Library Reference

RemoteFile.GetModificationTime Method 

Get the modification time of the remote file.

[Visual Basic]
Public Function GetModificationTime( _
   ByVal pathName As String _
) As Date
[C#]
public DateTime GetModificationTime(
   string pathName
);

Parameters

pathName
The remote file path name.

Return Value

The file's modification DateTime.

Remarks

This uses the MTDM command which is described in http://www.ietf.org/proceedings/02nov/I-D/draft-ietf-ftpext-mlst-15.txt. As this is draft and not part of the FTP standard, not all FTP servers will support it.

If supported, the file's modification time is returned as a UTC (GMT) time. You may use Date.ToLocalTime to convert UTC to local time.

If not supported, an exception is thrown. In this case, the List method may be used in conjunction with the DirectoryListParser class.

Exceptions

Exception TypeCondition
FtpException Thrown when the get modification time operation fails.

See Also

RemoteFile Class | ComponentSpace.Ftp Namespace