How do you check for a filetype in RGSS? I need to determine the difference between an mp3 and a midi, preferably via file extension, and preferably in a non-case-sensitive method.
What do you need it for. Depending on the application, you probably will not even need to know it. I know RGSS does not require the extension when loading files from the Cache, etc.
If that is not your problem, the simplest way to do it that I know would be to create a RegExp to look for the pattern of the file type you are searching for from the file's name.
Here is a regular expression which you can use.
Quote from: Zeriab on August 05, 2010, 07:53:42 am
Here is a regular expression which you can use.
Thanks you. I am not too savvy with RegExp, I would have had to research the exact syntax for that...
I made it as an example for my RegExp tutorial ^_^
Quote from: Zeriab on August 05, 2010, 03:27:47 pm
I made it as an example for my RegExp tutorial ^_^
Been a while since I read it...I better brush back up on it. :P