Skip to content
Advertisement

How do I check if a file is an executable in nim?

How do I check if a file is an executable on Linux using Nim? Thanks in advance.

Advertisement

Answer

You can use getFilePermissions and check if a certain FilePermission is in the set it returns.

JavaScript

You’d probably want to check if all three different Exec variants are in it:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement