substitute ffs()

windows libraries seem to lack this nice function