Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > net sftp getting file mtime ?

Reply
Thread Tools

net sftp getting file mtime ?

 
 
Une Bévue
Guest
Posts: n/a
 
      06-29-2011

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)
 
Reply With Quote
 
 
 
 
Une Bévue
Guest
Posts: n/a
 
      06-30-2011
Une Bévue <(E-Mail Removed)> 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-f...load-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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed connection to sftp server via Net::SFTP Kevin13 Perl Misc 3 12-01-2009 09:15 PM
Net::SFTP Fails, sftp OK MaggotChild Perl Misc 2 10-29-2009 11:01 AM
Problem with Net::FTP#mtime Daniel Berger Ruby 1 08-11-2006 07:55 PM
File.mtime: Bug on Windows? Axel Friedrich Ruby 0 03-31-2006 06:13 AM
File.mtime <=> DateTime.strptime() Hugh Sasse Ruby 7 09-11-2005 04:59 PM



Advertisments