title: When a file is executable for iOS?
body: <p>I created an app that compile Swift scripts or projects from server side, shows the output, and then the app downloads the executable file.</p>
  
  <p>I know I can't directly run this file, but I can do that from server side, so in my app's file explorer, it should be able to show a custom file icon if the file is executable. When the app downloads the file, this code is ran:</p>
  
  <pre><code>do {
      let attributes: [FileAttributeKey:AnyObject] = [FileAttributeKey.posixPermissions: NSNumber(value: 0o775 as UInt16)]
      try FileManager.default.setAttributes(attributes, ofItemAtPath: MY_FILE_PATH)
  } catch let error {
      print(error.localizedDescription)
  }
  </code></pre>
  
  <p>This is the code to check if the file is executable: </p>
  
  <pre><code>print("Is the file executable?")
  if FileManager.default.isExecutableFile(atPath: url.path) { // Is executable
      image.image = #imageLiteral(resourceName: "Exe")
      print("YES")
  }
  </code></pre>
  
  <p>But in the file explorer, the file icon is not the executable icon and there is no error setting file attributes.</p>
  
  <p>So my question is, when FileManager.default.isExecutableFile returns true?</p>
  
  <p>It's from file permissions or from architecture (the file is compiled for a Raspberry Pi and not for iOS) ?</p>