import Data.Char (toLower) filefold = map toLower . reverse . takeWhile ('/' /=) . reverse