net sftp getting file mtime ?

Discussion in 'Ruby' started by Une Bévue, Jun 29, 2011.

  1. Une Bévue

    Une Bévue Guest

    from an online tuto i get :
    sftp.stat("/path/to/file").mtime
    which don't work request doesn't have an mtime method...

    what is the correct syntax for getting, via sftp, a file, given by it's
    path, mtime ?
    --
    « Un nain a beau se tenir sur une montagne,
    il n'en est pas plus grand pour cela. »
    (Sénèque)
    Une Bévue, Jun 29, 2011
    #1
    1. Advertising

  2. Une Bévue

    Une Bévue Guest

    [Solved] net sftp getting file mtime ?

    Une Bévue <> wrote:

    > from an online tuto i get :
    > sftp.stat("/path/to/file").mtime
    > which don't work request doesn't have an mtime method...
    >
    > what is the correct syntax for getting, via sftp, a file, given by it's
    > path, mtime ?


    in fact a small typo (?) in the article :
    http://www.infoq.com/articles/ruby-file-upload-ssh-intro

    the correct syntax add a "!", that's all :
    sftp.stat!("/path/to/file").mtime
    _________^_______________________
    --
    « Les femmes ont raison de se rebeller contre les lois parce que
    nous les avons faites sans elles. »
    (Michel de Montaigne)
    Une Bévue, Jun 30, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hugh Sasse

    File.mtime <=> DateTime.strptime()

    Hugh Sasse, Sep 8, 2005, in forum: Ruby
    Replies:
    7
    Views:
    253
    tony summerfelt
    Sep 11, 2005
  2. Axel Friedrich

    File.mtime: Bug on Windows?

    Axel Friedrich, Mar 31, 2006, in forum: Ruby
    Replies:
    0
    Views:
    159
    Axel Friedrich
    Mar 31, 2006
  3. Daniel Berger

    Problem with Net::FTP#mtime

    Daniel Berger, Aug 11, 2006, in forum: Ruby
    Replies:
    1
    Views:
    200
    James Cribbs
    Aug 11, 2006
  4. MaggotChild

    Net::SFTP Fails, sftp OK

    MaggotChild, Oct 28, 2009, in forum: Perl Misc
    Replies:
    2
    Views:
    958
    C.DeRykus
    Oct 29, 2009
  5. Kevin13
    Replies:
    3
    Views:
    901
    Kevin13
    Dec 1, 2009
Loading...

Share This Page