ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
-1

Why can´t I open this files? [closed]

asked 2014-02-18 00:20:31 -0600

alex.filgueira gravatar image

Hi, I have a question. I´m use ROS Hydro in Ubuntu 12.04. When I try opening some files with Kate, or gedit, for example: /opt/ros/hydro/lib/rviz/rviz or /opt/ros/hydro/lib/hector_mapping/hector_mapping . The code opened is encoded. image description The type of this files is "executable (application / x-executable)" Why can´t I open this files? Ps: I want open this files to read, no for executed. Thanks

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by alex.filgueira
close date 2014-02-18 02:42:25

2 Answers

Sort by » oldest newest most voted
2

answered 2014-02-18 02:12:53 -0600

koenlek gravatar image

Hi Alex,

There is an important difference between source code files and executable files. This goes back to the very basics of programming. Source code files are text files, you can open then in a text editor and read them. Source code files are often used to generate executables. Executable files are binary files, they contain sequences of zeros and ones that are designed to give instructions to your computer (rviz for example contains binary code to enable your computer to perform tasks such as "create a window and draw sensor measurements from the sensor of port xx on the screen").

Practically, executables are not readible by humans: it consists of a very low level 'processor language', as opposed to a source file which contains a fairly straightforward human understandable programming language.

As I said before, in many languages source code files are used to generate executable files. A compiler is used to compile source code into binary files. Languages like c++, c and java need to be compiled. Other languages like html and python can be executed directly, without the need to compile. What actually happens is that an interpreter turns the code in real-time into machine executable instructions for your processor.

Good luck!

P.s. In ROS, catkin_make or rosmake take care of compiling.

P.p.s. Strictly speaking a source code file is of course also described by zeros and ones, but in such a way that your text editor can turn it into text. Executable files can't be turned into some form of text easily. When people are hacking and/or reverse-engineering executable, they sometimes try to figure out how to understand and/or manipulate (=edit) binary files.

For more info you can check: http://en.wikipedia.org/wiki/Executable (espacially the part: Generation of executable files) http://en.wikipedia.org/wiki/Binary_file http://en.wikipedia.org/wiki/Source_code

edit flag offensive delete link more

Comments

Thanks, I thought that these files were equals to files.py etc.

alex.filgueira gravatar image alex.filgueira  ( 2014-02-18 02:40:56 -0600 )edit
1

answered 2014-02-18 02:12:51 -0600

bchr gravatar image

updated 2014-02-18 02:15:43 -0600

You are trying to read executables... These are not scripts, they are compiled to be executed by your machine in a language that is not meant to be understood by humans. If you want to read the source code that was used to generate these executables, well, get the source code and read it. For instance for rviz, you can find it there.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-02-18 00:20:31 -0600

Seen: 413 times

Last updated: Feb 18 '14