tags:

views:

146

answers:

3

Hi,

I got some file sample.mt from client, and when i open info, it reveals as UNIX Executable

file. But, actually when i replaced the extension with zip, i could extract the file content.

And it appears to be folder. Can any one say what exactly UNIX Executable file means and how

is it created. By the way, that is created in Windows OS it seems.

+1  A: 

A native binary executable for a Unix will have a MAGIC_COOKIE at the front which will say what its type is. The command file file_name_which_might_a_binary will tell you if your Unix understands that format. If the file command returns "directory" then it is probably not an executable but rather a directory (or folder).

msw
-bash: /Users/lenin/Desktop/Sample: cannot execute binary fileThis is the statement when i tried on my terminal. What can be the reason behind it.
iSight
The reason is that it's not an executable binary file suitable for your platform.
Álvaro G. Vicario
use the command that @msw suggested to find out what sort of file it is before executing. Why don't you ask your client what type of file it is if you can't do that yourself?
Helen Neely
Hi, This is what i got when i carry out on @msw suggestion./Users/lenin/Desktop/sample file_name_which_might_a_binary-bash: /Users/lenin/Desktop/Ssample cannot execute binary file
iSight
They mean for you to run the "file" command with your filename as the only argument. At the terminal, type "file " (including the space but not the quotes), then drag and drop the file from your desktop to your terminal. Then press enter.
pra
+1  A: 

Many times when you copy a file from Windows to Unix the copy is created with the executable bits on. That does not mean it is an executable program.

lhf
A: 

That's the file client created on some other platform and i have to read that file programmatically in Mac OS X

If read means execute, well, you cannot: you tried to run it and it would not run. Then it's not a valid MacOS X program. Period. He can send you a JPEG picture and you won't be able to run it no matter what you try.

If read means extract some piece data, the issue of being a Unix executable or not is completely irrelevant. You need to:

  1. Know the format specification
  2. Use a tool to extract data or code your own

You must be omitting important information because I don't think that someone just dropped a file in your inbox and asked for an estimate to "read the file".

Álvaro G. Vicario
Ya i should carry out what you meant for. Any way, thanks for your suggestion.
iSight