+ 5

regarding Ruby's "File.executable?" method, How do I make a file executable?

28th Jun 2019, 7:30 PM
SapphireBlue
SapphireBlue - avatar
6 Answers
+ 2
From what I've seen, there's a library called OCRA for Ruby to make exe files.
28th Jun 2019, 7:43 PM
Luk
Luk - avatar
+ 2
Hi. For Linux it would be chmod u+x _filename_ Hope that helps. Cheers. C.
28th Jun 2019, 7:45 PM
ChrA
ChrA - avatar
+ 2
Raphi Spoerri if you are successful, you might not want to release the program. It might not be received well if you don't tell others exactly what it does and why. In Windows systems text files become executable batch files by adding .bat extension. Exe and com files are binary files that are directly executed by the system although the header of the exe file tells the system how big the file is. This should be equal to or less than the actual file size or you will get errors or invalid data. Linux determines if a file is executable with 3 octal numbers indicating readability and executability status. In linux chmod sets or removes attributes similar to Windows chattr command though linux works like UNIX in storing parameters for the file owner, the group, and other users. The attributes are read, write, and execute. Read is binary 001 write is 010 and execute is 100. For a file to be executed the user must have executable and read privileges in one of the 3 user types and read access to the directory.
4th Jul 2019, 3:53 PM
Roger Greenlaw
+ 1
by compile it to executeable. or ran the file in the interpreter. which language you're asking ?
28th Jun 2019, 7:31 PM
Taste
Taste - avatar
+ 1
What language, what operating system – then you can easily find it on internet. Not all languages support it so well though.
28th Jun 2019, 7:32 PM
Luk
Luk - avatar
+ 1
You obviously missed to spell out your actual question. And you are still missing to answer the question of the guys trying to help. If you start typing a script in some Linux editor it usually does not come with the right to execute the code contained. What you will have to do in this case is to set this permission by running to command I stated above. To run the file named _filename_ type ./_filename_
28th Jun 2019, 8:07 PM
ChrA
ChrA - avatar