Executes the FTP command MDTM Show last modification time of file. MDTM is not specified in RFC 959. @param[in] strPath Pathname of a file. @param[out] strModificationTime Modification time of the file specified in pathname. @return see return values of CFTPClient::SimpleErrorCheck
| 1836 | /// @param[out] strModificationTime Modification time of the file specified in pathname. |
| 1837 | /// @return see return values of CFTPClient::SimpleErrorCheck |
| 1838 | int CFTPClient::FileModificationTime(const tstring& strPath, tstring& strModificationTime) const |
| 1839 | { |
| 1840 | strModificationTime.erase(); |
| 1841 | |
| 1842 | CReply Reply; |
| 1843 | if( !SendCommand(CCommand::MDTM(), strPath, Reply) ) |
| 1844 | return FTP_ERROR; |
| 1845 | |
| 1846 | if( Reply.Value().length()>=18 ) |
| 1847 | { |
| 1848 | tstring strTemp(Reply.Value().substr(4)); |
| 1849 | size_t iPos=strTemp.find(_T('.')); |
| 1850 | if( iPos!=tstring::npos ) |
| 1851 | strTemp = strTemp.substr(0, iPos); |
| 1852 | if( strTemp.length()==14 ) |
| 1853 | strModificationTime=strTemp; |
| 1854 | } |
| 1855 | |
| 1856 | if( strModificationTime.empty() ) |
| 1857 | return FTP_ERROR; |
| 1858 | |
| 1859 | return SimpleErrorCheck(Reply); |
| 1860 | } |
| 1861 | |
| 1862 | /// Show last modification time of file. |
| 1863 | /// @param[in] strPath Pathname of a file. |