Re: Could this be faster?
- Posted by C Bouzy <eucoder at hotmail.com> Dec 16, 2005
- 555 views
petelomax wrote: > The above works fine here. Did you change get_file_ext? > I already had a function called get_file_ext, so I used mines instead. I assumed your version was the same as mines, I assumed wrong. Here is the version I am using:
function get_file_ext(sequence fname) for i = length (fname) to 1 by -1 do if fname [i] = '.' then return fname [i + 1 .. length (fname)] elsif fname [i] = '\\' or fname [i] = '/' then return "" end if end for return "" end function
Then all I do is check for the file extensions
if find(get_file_ext(lower(fname)),{"aac","mp4", "mp3","mp2", "mp1", "ogg", "wav"}) then
----If you continue to do what you have always done, you will get what you have always gotten.----