0

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.

2
  • The exact meaning of UNIX Executable depends on the exact tool that's giving you such info. Are you trying to detect Unix binaries programmatically or someone sent you a file and you want to know what it is? Commented Mar 12, 2010 at 12:44
  • That's the file client created on some other platform and i have to read that file programmatically in Mac OS X. Commented Mar 12, 2010 at 12:49

3 Answers 3

2

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".

Sign up to request clarification or add additional context in comments.

1 Comment

Ya i should carry out what you meant for. Any way, thanks for your suggestion.
1

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).

5 Comments

-bash: /Users/lenin/Desktop/Sample: cannot execute binary file This is the statement when i tried on my terminal. What can be the reason behind it.
The reason is that it's not an executable binary file suitable for your platform.
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?
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
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.
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.