Fot those of you who don't get the thread's title at all, let me explain what I mean... well of course, it has to do with the filename reading/opening code in Ruby RGSS, i.e. something like this:
Well, let's say, though, I want to have variable filenames I can't line up like numbers to work with the for x in 0..n function. Instead, those might be filenames like "TestExample.txt", "TestWhatever.txt", "TestPlaceholder.txt", whatever you can think of... well, the key element is the "Test" in all of those, as I search for a method with which I can check if there's a file with this component in *.txt format... I tried the .exist? method, but I didn't succeed... I hope you can help me out with this...
EDIT: Oh, and while on it, it'd be handy to know how one'd be able to open all files in a directory in a for x in 0..n like way, one after another...
Thanks in advance; please tell me if I expressed myself unclear...
Code:
file = File.open("Example.txt")
EDIT: Oh, and while on it, it'd be handy to know how one'd be able to open all files in a directory in a for x in 0..n like way, one after another...
Thanks in advance; please tell me if I expressed myself unclear...