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

J

John

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
 
J

John

# 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-->
:::
:::
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top