lib/slowfat/dir.rb
def to_s
      buf = ""
      @entries.each do |dentry|
        if(dentry.type == :file) then
          buf += sprintf("%-8s %-3s   %d\n", dentry.filename, dentry.extension, dentry.size)
        elsif(dentry.type == :directory)
          buf += sprintf("%-8s %-3s   <DIR>\n", dentry.filename, dentry.extension)
        end
      end

      buf
    end
##
# Convert a Directory into a vaguely DOS-style file listing
# @return [String] the contents of this directory, formatted as a human-readable listing
Convert a Directory into a vaguely DOS-style file listing
Convert a Directory into a vaguely DOS - style file listing
def to_s
      buf = ""
      @entries.each do |dentry|
        if(dentry.type == :file) then
          buf += sprintf("%-8s %-3s   %d\n", dentry.filename, dentry.extension, dentry.size)
        elsif(dentry.type == :directory)
          buf += sprintf("%-8s %-3s   <DIR>\n", dentry.filename, dentry.extension)
        end
      end
      buf
    end
def to_s buf = "" @entries . each do | dentry | if ( dentry . type == :file ) then buf += sprintf ( "%-8s %-3s   %d\n" , dentry . filename , dentry . extension , dentry . size ) elsif ( dentry . type == :directory ) buf += sprintf ( "%-8s %-3s   <DIR>\n" , dentry . filename , dentry . extension ) end end buf end
Convert a Directory into a vaguely DOS-style file listing
Convert a Directory into a vaguely DOS - style file listing
the contents of this directory, formatted as a human-readable listing
the contents of this directory formatted as a human - readable listing
String