From Directory.ls to ByteString

If you see this, this will emit a caseclass whenever a file under the given path is created modified or deleted. But if you can write the needed functions you can do something like: Source.repeat(givenDir).delay(tickInterval).map(listAllFilesInDir).map(_.map(file => ByteString(file.getname))) (you can use mapConcat too if you want single names instead of a seq of names)

1 Like