MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / FileModificationTime

Method FileModificationTime

deps/FtpClient/FTPClient.cpp:1838–1860  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1836/// @param[out] strModificationTime Modification time of the file specified in pathname.
1837/// @return see return values of CFTPClient::SimpleErrorCheck
1838int 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.

Callers

nothing calls this directly

Calls 6

eraseMethod · 0.80
ValueMethod · 0.80
substrMethod · 0.80
c_strMethod · 0.80
findMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected