Is rubyzip directory? broken?

S

Sammyo

In rubyzip-0.9.1 (an earlier version worked) the 'directory?' ( and
'file?') method
seem to be wrong. Am I missing a subtlety or is this a known issue?

Thanks
Sam

irb(main):063:0> Zip::ZipInputStream.open('/tmp/bar.zip') {|io|
irb(main):064:1* while not (entry = io.get_next_entry).nil?
irb(main):065:2> p entry.name
irb(main):066:2> p entry.directory?
irb(main):067:2> end
irb(main):068:1> }
"bar/"
false
"bar/baz/"
false
"bar/baz/fil2.txt"
false
"bar/fil1.txt"
false



:/tmp$ unzip -l bar.zip
Archive: bar.zip
Length Date Time Name
-------- ---- ---- ----
0 05-04-07 14:57 bar/
0 05-04-07 14:58 bar/baz/
6 05-04-07 14:57 bar/baz/fil2.txt
6 05-04-07 14:57 bar/fil1.txt
-------- -------
12 4 files
 

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,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top