Edu Posted May 29, 2017 Report Share Posted May 29, 2017 Boa tarde amigos! Criei uma rotina para alterar arquivos XML. A rotina está legal, mas a data de criação do arquivo está sendo alterada. Existe alguma forma de resolver isso, ou seja, alterar o arquivo sem mexer na data de criação do mesmo? Obs.: Estou usando as funções Memoread() e Memowrit(). Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 29, 2017 Report Share Posted May 29, 2017 ???? Não entendi?? Quote Link to comment Share on other sites More sharing options...
fladimir Posted May 30, 2017 Report Share Posted May 30, 2017 Vc altera, salva e depois roda o comando pra alterar a data do arquivo. função SetFDati() SetFDaTi() Sets the last change date and time of a file. Syntax SetFDaTi( <cFileName> , ; [<dFileDate>], ; [<cFileTime>] ) --> lSuccess Arguments <cFileName> This is a character string holding the name of the file to set date and time for. It must include path and file extension. If the path is omitted from <cFileName>, the file is searched in the current directory only. <dFileDate> This is the date value to be set. It defaults to the return value of Date(). <cFileTime> This is a time formatted string that defines the new file time. It defaults to Time(). Return The function returns .T. (true) if the file date and time is set, otherwise .F. (false) is returned. aferra 1 Quote Link to comment Share on other sites More sharing options...
Jorge Andrade Posted May 30, 2017 Report Share Posted May 30, 2017 Ou então faz do jeito Luso, altera em tempo de processamento a data do sistema conforme a data do arquivo, e após alteração do arquivo, retorna a data correta. ahauhauahuaua []s, Quote Link to comment Share on other sites More sharing options...
Edu Posted May 31, 2017 Author Report Share Posted May 31, 2017 Vc altera, salva e depois roda o comando pra alterar a data do arquivo. função SetFDati() SetFDaTi() Sets the last change date and time of a file. Syntax SetFDaTi( <cFileName> , ; [<dFileDate>], ; [<cFileTime>] ) --> lSuccess Arguments <cFileName> This is a character string holding the name of the file to set date and time for. It must include path and file extension. If the path is omitted from <cFileName>, the file is searched in the current directory only. <dFileDate> This is the date value to be set. It defaults to the return value of Date(). <cFileTime> This is a time formatted string that defines the new file time. It defaults to Time(). Return The function returns .T. (true) if the file date and time is set, otherwise .F. (false) is returned. Obrigado pela dica mas esta função não foi reconhecida no meu compilador. Existe algum include.ch que precisa ser importado no projeto? Quote Link to comment Share on other sites More sharing options...
fladimir Posted May 31, 2017 Report Share Posted May 31, 2017 vc tem q linkar junto a lib CT, se estiver usando harbour coloca hbct.hbc Quote Link to comment Share on other sites More sharing options...
Edu Posted June 2, 2017 Author Report Share Posted June 2, 2017 Resolvido! Obrigado fladimir. Tive que importar no projeto o arquivo ct.lib e efetuar o include de "directry.ch". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.