Git Product home page Git Product logo

Comments (6)

mscdex avatar mscdex commented on June 26, 2024

Yes, this was recently fixed in the readme recently and should be in the latest version on npm.

It's not the same attributes as fs.Stats though (see here).

from ssh2.

robogeek avatar robogeek commented on June 26, 2024

Okay.. so that means it's the "number of miliseconds since Jan 1 1970"? I tried this following and got file dates all over the map, from 1972 to 2034 .. That is, fs.stat returns a Date object, and Date.getTime() returns the number of milliseconds since the Epoch. Am I understanding this up right?

ctime: statz.ctime.getTime(),
atime: statz.atime.getTime(),
mtime: statz.mtime.getTime()

from ssh2.

mscdex avatar mscdex commented on June 26, 2024

There is no ctime. atime and mtime are UNIX timestamps, so it would be number of seconds since 1/1/1970.

So you want getTime() / 1000 instead.

from ssh2.

mscdex avatar mscdex commented on June 26, 2024

Ok, I've pushed some changes to allow for Date instances in ATTRS objects. I have also added utimes/futimes methods to make things simpler.

from ssh2.

mscdex avatar mscdex commented on June 26, 2024

Can you please try with the latest version now and see if setting atime and mtime work for you now?

from ssh2.

robogeek avatar robogeek commented on June 26, 2024

Yes, I just updated and reran my code and it works fine.

The tool is here:- https://github.com/robogeek/node-ssh2sync

from ssh2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.