We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am going to sort files by modification time after getting sftp.dir.glob
sftp.dir.glob
Do I have to sort files manually or default sort option is modification time?
The text was updated successfully, but these errors were encountered:
Net::SFTP.start(@host, @user, password: @password) do |sftp| files = [] sftp.dir.foreach(FILE_PATH) do |entry| files << { name: entry.name, mtime: entry.attributes.mtime } end files.sort_by { |file| file[:mtime] }.each do |file| Rails.logger.info "#{file[:name]} ---- #{file[:mtime]}" end end
files.sort_by { |file| file[:mtime] } may be the way you want to go.
files.sort_by { |file| file[:mtime] }
Sorry, something went wrong.
No branches or pull requests
I am going to sort files by modification time after getting
sftp.dir.glob
Do I have to sort files manually or default sort option is modification time?
The text was updated successfully, but these errors were encountered: