MacOS shown different behavior.<br><br>On Saturday, 11 March 2017, John Smith <<a href="mailto:jsmith5pam@yahoo.com">jsmith5pam@yahoo.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That is correct as long as the directory “files/“ exists. filename is set to an empty string this your concat statement appends an empty string to your constant string of “files/“ resulting in the path “files/“.<br>
<br>
<br>
> On Mar 10, 2017, at 1:53 PM, Proyb P via swift-users <<a href="javascript:;" onclick="_e(event, 'cvml', 'swift-users@swift.org')">swift-users@swift.org</a>> wrote:<br>
><br>
> let filename = ""<br>
> let checkfile = FileManager.default<br>
> var isDir : ObjCBool = false<br>
> if checkfile.fileExists(atPath: "files/"+filename, isDirectory: &isDir) {<br>
> print("true")<br>
> } else {<br>
> print("false")<br>
> }<br>
><br>
> 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.<br>
><br>
> A temporary workarounds is to use<br>
> let filename = "NOTFOUND"<br>
> ______________________________<wbr>_________________<br>
> swift-users mailing list<br>
> <a href="javascript:;" onclick="_e(event, 'cvml', 'swift-users@swift.org')">swift-users@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br>
<br>
</blockquote>