开发者

UNIX Executable File

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 coul开发者_StackOverflowd 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.


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


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜