문제

How do I get the last time stamp of a .txt file from WinSCP when using .txt and .bat scripting?

도움이 되었습니까?

해결책

Well, you should better state, what do you want to do with the timestamp. You might get better answer then.

Anyway:

  1. WinSCP has the stat command:

    stat /home/martin/index.html
    

    Outputs something like:

    -rwxr--r--   0                       20480 Jan  5 14:09:33 2009 index.html
    

    You can redirect the output of the WinSCP script to a file and parse.

    Or even better use XML logging and parse the XML log.

  2. Easier solution may be to make use of WinSCP .NET assembly method Session.GetFileInfo.

    An additional example (to those linked in the method documentation) is here:
    https://winscp.net/eng/docs/scriptcommand_stat#net

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top