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 ?
     
    Une Bévue, Jun 29, 2011
    #1
    1. Advertisements

  2. Une Bévue

    Une Bévue Guest

    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
    _________^_______________________
     
    Une Bévue, Jun 30, 2011
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.