This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[1.7] Surprising exe magic?


  Assume, for the sake of argument, that hw.c contains some C code.

admin@ubik /tmp/exemagic
$ gcc hw.c  -o hello.x

admin@ubik /tmp/exemagic
$ ls -la
total 125
drwxr-xr-x 1 DKAdmin None     0 May 24 20:36 .
drwxrwxrwt 1 DKAdmin None 90112 May 24 20:36 ..
-rwxr-xr-x 1 DKAdmin None 34326 May 24 20:36 hello.x
-rw-r--r-- 1 DKAdmin None   121 May 24 20:36 hw.c

admin@ubik /tmp/exemagic
$ ./hello.x
Hello, .exe magic!

admin@ubik /tmp/exemagic
$ mv hello.x hello.test.x

admin@ubik /tmp/exemagic
$ ls -la
total 125
drwxr-xr-x 1 DKAdmin None     0 May 24 20:36 .
drwxrwxrwt 1 DKAdmin None 90112 May 24 20:36 ..
-rwxr-xr-x 1 DKAdmin None 34326 May 24 20:36 hello.test.x.exe
-rw-r--r-- 1 DKAdmin None   121 May 24 20:36 hw.c

  I expect this is probably one of those things that there's no way to avoid
without breaking some far more common usage, perhaps?  It's not that bad since
it still runs as expected, and you can rename it again explicitly to get the
name you really wanted:

$ ./hello.test.x
Hello, .exe magic!

admin@ubik /tmp/exemagic
$ ls
hello.test.x.exe  hw.c

admin@ubik /tmp/exemagic
$ mv hello.test.x.exe hello.test.x

admin@ubik /tmp/exemagic
$ ls
hello.test.x  hw.c

... but I found it a bit surprising.  Is it supposed to happen like this?  I
had a look in the recent announcement posts, and in /usr/share/doc, and
couldn't find much explicit documentation about how exe magic works, but I
noted that mv doesn't support `--disable-exe-magic'.

    cheers,
      DaveK


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]