Fast check if files exist

I have list (array) of file names in the form:

5_4.3g2
5_5.3gp
5_6.3gp
.
.
.

What’s the fastest way I can check if these files exist in a given
directory?

On Aug 24, 2007, at 10:05 PM, eggie5 wrote:

I have list (array) of file names in the form:

5_4.3g2
5_5.3gp
5_6.3gp

My bet:

(filenames - Dir.entries(dirname)).empty?

– fxn

On Aug 24, 1:10 pm, Xavier N. [email protected] wrote:

(filenames - Dir.entries(dirname)).empty?

– fxn

AHHH very clever and it seems to work!

Thanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs