0

Hello.

I'm having a hard time figuring this out.
I want to open a file, but I don't know the filename. I know the directory the file resides in, and I know the extension ('.lay'), and I know there is only one file with that extension in the directory.

How can I do this and still have portable code?
I was thinking I could get the directory listing and test each file and see if it ends with ".lay".

Any other ideas out there?

Thanks
-V-

3
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by iamthwee
0

ms-windows call GetFirstFile() and GetNextFile(), or in *nix call opendir() and readdir(). If you used c++ you can use boost library that is portable between these two operating systems (I don't know a thing about MAC).

0

Damn. I was afraid there wasn't a standard cross-platform way to do this. Oh well, I just have to write a wrapper, then.

Thanks for the fast reply :)

-V-

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.