let filename = ""
let checkfile = FileManager.default
var isDir : ObjCBool = false
if checkfile.fileExists(atPath: "files/"+filename, isDirectory: &isDir) {
print("true")
} else {
print("false")
}

On Linux, if the "filename" variable is empty string, checkfile will
returns as true which should be return as false since the file is not
found. macOS is working fine.

A temporary workarounds is to use
let filename = "NOTFOUND"
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to