Need a gem or code to retrieve file Summary information with Ruby /Windows

Discussion in 'Ruby' started by John, May 11, 2010.

  1. John

    John Guest

    Need a gem or code for Windows to retrieve file Summary information
    with Ruby.

    In writing a indexing program, I need the following fields from the
    file properties
    "summary information": such as Title, Subject, Author, Comments.

    Thanks for the assistance,
    John
     
    John, May 11, 2010
    #1
    1. Advertising

  2. John

    John Guest

    Re: Need a gem or code to retrieve file Summary information with Ruby/ Windows

    # Ruby code to read Windows file summary information

    require 'win32ole'

    obj= WIN32OLE.new("Shell.Application")
    folder=obj.nameSpace("d:\\0-dwn")
    item = folder.items.item("test.doc")
    (0..99).each do |i|
    puts "#{i}-->"+folder.getDetailsOf(nil, {:iColumn => i }) +"--
    >"+folder.getDetailsOf(item, {:iColumn => i })

    end

    Output:
    0-->Name-->test.doc
    1-->Size-->20 KB
    2-->Type-->Microsoft Word Document
    3-->Date Modified-->5/14/2010 1:48 PM
    4-->Date Created-->5/14/2010 11:09 AM
    5-->Date Accessed-->5/14/2010 1:48 PM
    6-->Attributes-->A
    7-->Status-->Online
    8-->Owner-->ACER1\john_s
    9-->Author-->Au: John S
    10-->Title-->Tit: test
    11-->Subject-->Sj: Test file summary
    12-->Category-->Cat:Test verification
    13-->Pages-->1
    14-->Comments-->Com: test file verification program
    15-->Copyright-->
    16-->Artist-->
    17-->Album Title-->
    18-->Year-->
    19-->Track Number-->
    20-->Genre-->
    21-->Duration-->
    22-->Bit Rate-->
    23-->Protected-->
    24-->Camera Model-->
    25-->Date Picture Taken-->
    26-->Dimensions-->
    27-->-->
    28-->-->
    29-->Episode Name-->
    30-->Program Description-->
    31-->-->5/14/2010 10:41 AM
    32-->Audio sample size-->
    33-->Audio sample rate-->
    34-->Channels-->
    35-->Company-->
    36-->Description-->
    37-->File Version-->
    38-->Product Name-->
    39-->Product Version-->
    40-->Keywords-->
    :::
    :::
     
    John, May 15, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    0
    Views:
    452
    Guest
    Nov 3, 2003
  2. Wenwei Weng
    Replies:
    8
    Views:
    751
    Marcel
    Jun 28, 2004
  3. Austin 7873
    Replies:
    5
    Views:
    215
    Eric Hodel
    Jan 27, 2007
  4. Brandon Simmons
    Replies:
    0
    Views:
    383
    Brandon Simmons
    Dec 22, 2010
  5. Iñaki Baz Castillo
    Replies:
    1
    Views:
    175
    Iñaki Baz Castillo
    Feb 28, 2011
Loading...

Share This Page