From 598bd6905829d6675801d1256e4d4f37f2785bdb Mon Sep 17 00:00:00 2001 From: Carl N Baldwin Date: Thu, 20 Oct 2005 14:23:10 -0600 Subject: [PATCH] The ruby versions are slower --- scripts/files-from-date.rb | 15 --------------- scripts/list-dates.rb | 17 ----------------- 2 files changed, 32 deletions(-) delete mode 100755 scripts/files-from-date.rb delete mode 100755 scripts/list-dates.rb diff --git a/scripts/files-from-date.rb b/scripts/files-from-date.rb deleted file mode 100755 index 4fde0c5..0000000 --- a/scripts/files-from-date.rb +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/ruby - -# Make sure the record separator is zero rather than new-line -$/ = "\0" - -# The only argument is the date for which to list files -date = ARGV.shift.to_i - -ARGF.each do |line| - # The seventh and eigth fields are the backup date and the file name. - backupdate,name = line.split( ' ', 8 )[6,7] - - # Print the name if the backup date matches - print name if date == backupdate.to_i -end diff --git a/scripts/list-dates.rb b/scripts/list-dates.rb deleted file mode 100755 index 18cdef9..0000000 --- a/scripts/list-dates.rb +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/ruby - -# Make sure the record separator is zero rather than new-line -$/ = "\0" - -# Create a set of backup dates -require 'set' -dates = SortedSet.new - -# Split each input record into 8 fields on spaces and grab the 7th as integer -date_array = ARGF.map { |rec| rec.split( ' ', 8 )[6].to_i } - -# Merge the dates into the set -dates.merge date_array - -# Output the sorted set -puts dates.to_a -- 2.34.1