how can I read(check) a temp file created on my system please.
I need to check if a temp file exists or not using scala,
how can i do this.
Try this:
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
val fileSystem = FileSystem.get(new Configuration())
val path = new Path("/tmp/foo/bar/meow.parquet")
if (fileSystem.exists(path)){
// TODO ...
}
It will work on local, Docker and remote file-systems (S3 & HDFS) fluently
Hope it helps