1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

the extention .exe cannot be run under osx?

Discussion in 'General Mac Discussion' started by SLJ, Jul 23, 2003.

  1. SLJ
    macrumors regular

    #1
    i am new to OSX & Apple Mac... anyway, I want to know if the .exe extention can be run under OSX or .exe is not for apple mac all together? Someone send me a file which have .exe and I am not sure how to run it...
     
  2. macrumors G5

    Sun Baked

    #2
    Usually it means it's a Window's file, but sometimes some of the compressed files with that extension can be opened using some of the third-party programs.

    But this is also what makes some of the viruses hard to spread to the Mac when they come as a .exe file.
     
  3. macrumors 6502a

    Vlade

    #3
    .exe means a windows program, so 99% of the time you can't open it, just like you cant open a .app file on a PC
     
  4. SLJ
    macrumors regular

    #4
    hmm, okay thank guys... so if a .sit unpack a .exe? that is still a PC file right?
    Anyway to convert it or which 3rd party program do I need to use to open?
     
  5. macrumors 603

    rainman::|:|

    #5
    If it's compressed, the standard is generally Stuffit by Aladdin Systems. They have a free version and a pay version.

    You can also use .exe files by purchasing VirtualPC, which lets you run a Windows enviroment on your Mac, albeit very very slowly... It still comes in handy for occasional stuff, like email attachments.

    Very rarely are those .exe attachments worth viewing anyway tho ;) Once you've seen elf bowling once, you've seen it a thousand times...

    pnw
     
  6. macrumors 6502

    NNO-Stephen

    #6
    yeah, generally a .exe cannot be opened on a Mac. .exe is the Windows equivalent of a .app which can only be opened on a macintosh.
     
  7. macrumors 68030

    Flowbee

    #7
    Thank God! That's why I switched. :cool:
     
  8. macrumors 65816

    voicegy

    #8
    hahaha! EXACTLY! I've yet to see one that was worth keeping...and I'm personally GLAD that the Mac OS can't run them. They're the #1 Time-Waster in offices everywhere...besides Windows itself, of course! :)
     
  9. Administrator

    Doctor Q

    Staff Member

    #9
    It is unusual to find an .exe (Windows executable) file within a .sit (StuffIt) file, because StuffIt is one of the standard compression and packaging formats for Macintosh files as is rarely used for Windows files. In the Windows world, .zip format is the standard for compression and packaging. In the Unix world (which includes Mac OS X), .tar is the standard packaging format and .Z and .gz are the standards for compression.

    By "standard" I mean "most common". There is nothing to prevent any file from being compressed and/or packaged in any of these formats.
     
  10. SLJ
    macrumors regular

    #10
    Yes, I learned from the hard way, I just downloaded a file - which is 200MB and my mac have no idea what do to with it and I have no idea what do to with it... now I have to seach for the mac version of the file.
     
  11. macrumors 601

    zimv20

    #11
    unix doesn't identify files by the extension. it uses something inside the file called a magic number.

    (individual apps, however, may rely on the extension)

    so -- an .exe that doesn't work on unix has problems because it has a missing or malformed magic number (being a PC-only file would cause that), not because of the extension.

    as humans, we recognize the .exe extension and associate it w/ windows. but unix doesn't care.
     
  12. macrumors 65816

    maradong

    #12
    exact => 5/5
    great summary ;-)
     
  13. macrumors 65816

    mrjamin

    #13
    and that, my friends, is one of the hundreds of reasons why OSX + all other Unix OS's are far superior than all things Windoze.
     
  14. macrumors 601

    zimv20

    #14
    thank you
     
  15. macrumors 601

    zimv20

    #15
    hey! a friend sent me her link a couple months ago. i forwarded it and, pretty soon, they stopped offering mp3 samples.

    have you actually gone on and bought CDs?
     
  16. macrumors Penryn

    Abstract

    #16
    You can't open .zip files on a Mac, right? I've never even tried.
     
  17. macrumors 6502a

    Juventuz

    #17
    Sure you can, I've unzipped plenty of files on my Mac. They almost always contain pics that Windoze users send me though.

    All you need is Stuff It. It's just like unstuffing a .sit file.
     
  18. macrumors 68000

    GeeYouEye

    #18
    There are rare occasions when .exe files can be run... the Folding@home core is an .exe file for example. Just has to be run in the Terminal.
     
  19. macrumors 65816

    voicegy

    #19
    hahaha! you ROCk, mrjamin. Thanks to you and MacRumors, Wing got more hits than it could handle.

    zimv20, someone I sent the link to weeks ago bought one of her cd's and made me a cassette tape of it. It's WONDERFUL!:p
     
  20. macrumors 601

    zimv20

    #20
    sweet. i love this quote from her homepage:
     
  21. macrumors regular

    #21
    Close.

    Yes, it's true that Windows and DOS uses file extensions to determine whether something is executable or not. UNIX, however, uses permissions -- if something has the executable set and you try to execute it, the kernel will attempt to execute it.

    How the file gets executed, however, is similar on Windows/DOS to the way its done on UNIX.

    DOS will look at the first couple of bits of the file to determine how the file gets executed. Take a look at an .EXE file and you'll notice that the first two bytes are "MZ". There are similar bytes for .COM files. There are other bytes that will further determine what kind of .EXE file it is, how it uses memory, etc.

    UNIX also looks at the first few byes, as well as a few others. UNIX is a bit more comprehensive, however, in its methods. There's a file called /etc/magic that UNIX uses to determine what type of file it is (it can even recognize, though not execute, DOS binaries.)

    The "magic number" just identifies the type of file and how it gets executed (if at all.) Whether it gets executed or not depends on the extension (in DOS and Windows), or on the executable bit (in UNIX.)
     
  22. Administrator

    Doctor Q

    Staff Member

    #22
    As long as we're explaining how executables work, here are some more details about scripts...

    Unix can identify a script (a readable text file containing commands in an interpreted language) by the characters #! at the front of the file. Following the #! you can put the path to the interpreter (an executable that will be invoked to interpret your file). The default is usually the Bourne shell or the Korn shell (e.g., path /bin/sh). This is how shell scripts (Bourne, C, Korn, Bourne again, tcsh, etc.) get invoked. Same for Perl scripts.

    If a file is a shell script, it may not have to have execute permission because it is the interpreter (e.g., /bin/perl) that must be executable, while the file containing the script only needs to be readable.
     
  23. macrumors 601

    zimv20

    #23
    afaik, if you're typing the name of the file, you need to chmod it to be executable. try it.
     
  24. macrumors regular

    #24
    Yep, you're right. The "#!" at the beginning is typically called a "shebang" and happens to be the "magic number".

    A shell script still needs to have execute permission, as does the interpreter itself. The only exception is for a script that gets sourced in by another script (a good example is a typical .profile file.) These scripts do not need to have the execute bit set, as they are only read in by the sourcing script (with commands executed under that script's context.)
     
  25. Administrator

    Doctor Q

    Staff Member

    #25
    In Terminal, you invoke commands by typing the command name, or a path and command name. When invoked that way, the command should have execute permission. But you can also invoke a shell script by naming the shell and the shell script file, e.g., sh myscript, in which case the shell script only needs read permission.

    Programs and scripts can also be executed by the operating system or by other applications. Examples: The at, batch, and cron commands execute commands in the background (i.e., without showing their output on the screen) on a sheduled basis. A web server (e.g., Apache) will execute commands in its cgi-bin directory when the appropriate URLs are specified by a web browser connecting to that server. And lots of applications have plug-ins, filters, and other extras that are executable code. So there are lots of ways that programs get invoked!
     

Share This Page