Can't make file executable (Win 7, 64-bit)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't make file executable (Win 7, 64-bit)

Wayne Watson
I have a file, Meteor, which someone gave me from another Linux that is
supposed to be executable. The permissions show -rw-r--r-- 1.  if I use
chmod +x Meteor, it doesn't change the permissions.

 From file Meteor
Meteor: ELF 32-bit LSB executable. Intel 80836 1 <SYSV>, statically
linked, not stripped.

How do I copy anything out of the shell window?

--
            Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

              (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
               Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet

                      CE 1955 October 20 07:53:32.6 UT
                     -- "The Date" The mystery unfolds.

                     Web Page:<www.speckledwithstars.net/>



------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Can't make file executable (Win 7, 64-bit)

Wayne Watson
As it turns out, I'm on Win 7, and the executable is from Linux.

Still curious about my copy question.

On 1/2/2012 3:52 PM, Wayne Watson wrote:

> I have a file, Meteor, which someone gave me from another Linux that is
> supposed to be executable. The permissions show -rw-r--r-- 1.  if I use
> chmod +x Meteor, it doesn't change the permissions.
>
>   From file Meteor
> Meteor: ELF 32-bit LSB executable. Intel 80836 1<SYSV>, statically
> linked, not stripped.
>
> How do I copy anything out of the shell window?
>

--
            Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

              (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
               Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet

                      CE 1955 October 20 07:53:32.6 UT
                     -- "The Date" The mystery unfolds.

                     Web Page:<www.speckledwithstars.net/>



------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Can't make file executable (Win 7, 64-bit)

Tor Lillqvist
In reply to this post by Wayne Watson
> I have a file, Meteor, which someone gave me from another Linux that is
> supposed to be executable. The permissions show -rw-r--r-- 1.

Windows is not Unix. There are no rwxrwxrwx bits in Windows. MSYS's
concept of "executability" is just imagination, based on a best guess
based on the file name, not its contents (as far as I know). As the
file's name doesn't end with .exe (or .bat, or .cmd, or any other
registered "script" file type), there is no reason for MSYS to
consider it "executable".

Try the following in a MSYS shell:

echo This is certainly not an executable file >foobar.exe
ls -l foobar.exe
chmod -x foobar.exe
ls -l foobar.exe

Whether Windows can execute a file or not has little relation to
whether MSYS thinks it is "executable" or not. Even if you would
change the name of your Linux executable to Meteor.exe, you still
obviously couldn't run it.

--tml

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Can't make file executable (Win 7, 64-bit)

Keith Marshall
On 03/01/12 06:04, Tor Lillqvist wrote:
>> I have a file, Meteor, which someone gave me from another Linux that is
>> supposed to be executable. The permissions show -rw-r--r-- 1.
>
> Windows is not Unix. There are no rwxrwxrwx bits in Windows. MSYS's
> concept of "executability" is just imagination, based on a best guess
> based on the file name, not its contents (as far as I know).

This is not entirely true.  Yes, MSYS will consider a file to be an
executable, regardless of its content, if it bears the .exe extension to
its name.  It will attempt to invoke such programs by passing them to
the windows loader, which may then choke, and spit out some error
dialogue if the content is not valid [PE-]COFF executable code.

> As the file's name doesn't end with .exe (or .bat, or .cmd, or any
> other registered "script" file type), there is no reason for MSYS to
> consider it "executable".

This isn't necessarily true; MSYS may also consider a file, with any
arbitrary extension, to be executable if its content is appropriate.
Specifically, if the initial part of the file, (up to the first line
break), represents a valid shebang, MSYS will consider it to be an
executable script, and will invoke the nominated interpreter to execute
it.  Hence file foo.awk, with (trivial) content:

  #! /bin/awk -f
  BEGIN { print "Hello World." }

is a valid executable under MSYS; (you don't even need to chmod it --
indeed, either chmod -x or chmod +x is effectively a no-op):

  $ ls -l foo.awk
  -rwxr-xr-x 1 keith Administrators 46 Jan  3 13:44 foo.awk

  $ ./foo.awk
  Hello World.

> Try the following in a MSYS shell:
>
> echo This is certainly not an executable file >foobar.exe
> ls -l foobar.exe
> chmod -x foobar.exe
> ls -l foobar.exe

MSYS will believe it to be executable, and will try to run it; the
windows loader will reject it, if you ask MSYS to run it.

--
Regards,
Keith.

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Can't make file executable (Win 7, 64-bit)

Earnie Boyd


On Tue, Jan 3, 2012 at 9:04 AM, Keith Marshall <[hidden email]> wrote:
On 03/01/12 06:04, Tor Lillqvist wrote:
>> I have a file, Meteor, which someone gave me from another Linux that is
>> supposed to be executable. The permissions show -rw-r--r-- 1.
>
> Windows is not Unix. There are no rwxrwxrwx bits in Windows. MSYS's
> concept of "executability" is just imagination, based on a best guess
> based on the file name, not its contents (as far as I know).

This is not entirely true.  Yes, MSYS will consider a file to be an
executable, regardless of its content, if it bears the .exe extension to
its name.  It will attempt to invoke such programs by passing them to
the windows loader, which may then choke, and spit out some error
dialogue if the content is not valid [PE-]COFF executable code.

Text files beginning with #! are also considered to have the executable bit.
 

> As the file's name doesn't end with .exe (or .bat, or .cmd, or any
> other registered "script" file type), there is no reason for MSYS to
> consider it "executable".

This isn't necessarily true; MSYS may also consider a file, with any
arbitrary extension, to be executable if its content is appropriate.
Specifically, if the initial part of the file, (up to the first line
break), represents a valid shebang, MSYS will consider it to be an
executable script, and will invoke the nominated interpreter to execute
it.  Hence file foo.awk, with (trivial) content:

I see you go into that here.    Also though an executable binary file doesn't have to end in .exe to be executed by MSYS.  An example, 

cd $HOME
cp /bin/ls.exe ./ls
./ls -l

In fact the binutils ld must be given a special switch to add a .exe suffix to the created executable if the output name doesn't contain it.  This is done when GCC spawns ld. See the online manuals for --force-exe-suffix.

--
Earnie


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Can't make file executable (Win 7, 64-bit)

Wayne Watson
In reply to this post by Tor Lillqvist
I'm just going to re-compile the source code in gfortran under Win 7.

On 1/2/2012 10:04 PM, Tor Lillqvist wrote:

>> I have a file, Meteor, which someone gave me from another Linux that is
>> supposed to be executable. The permissions show -rw-r--r-- 1.
> Windows is not Unix. There are no rwxrwxrwx bits in Windows. MSYS's
> concept of "executability" is just imagination, based on a best guess
> based on the file name, not its contents (as far as I know). As the
> file's name doesn't end with .exe (or .bat, or .cmd, or any other
> registered "script" file type), there is no reason for MSYS to
> consider it "executable".
>
> Try the following in a MSYS shell:
>
> echo This is certainly not an executable file>foobar.exe
> ls -l foobar.exe
> chmod -x foobar.exe
> ls -l foobar.exe
>
> Whether Windows can execute a file or not has little relation to
> whether MSYS thinks it is "executable" or not. Even if you would
> change the name of your Linux executable to Meteor.exe, you still
> obviously couldn't run it.
>
> --tml
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
> Also: mailto:[hidden email]?subject=unsubscribe
>

--
            Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

              (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
               Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet

                      CE 1955 October 20 07:53:32.6 UT
                     -- "The Date" The mystery unfolds.

                     Web Page:<www.speckledwithstars.net/>



------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe