Re: Need Simple Way To Determine If File Is Executable

2006-12-21 Thread Tim Roberts
Sebastian 'lunar' Wiesner <[EMAIL PROTECTED]> wrote: > >Fredrik Lundh <[EMAIL PROTECTED]> schrieb > >> Sebastian 'lunar' Wiesner wrote: >> you're confusing the shell's "is this file executable" check with the loader's "can I execute this file" check: >... >Well, that doesn't tell us anyt

Re: Need Simple Way To Determine If File Is Executable

2006-12-21 Thread Fredrik Lundh
Sebastian 'lunar' Wiesner wrote: >> no, I'm showing that a local file marked as executable overrides a >> shared one, even if the local file isn't actually an executable. > > Only if you have your system set up badly. The current directory > should not be in the search path, a

Re: Need Simple Way To Determine If File Is Executable

2006-12-21 Thread Sebastian 'lunar' Wiesner
Fredrik Lundh <[EMAIL PROTECTED]> schrieb > Sebastian 'lunar' Wiesner wrote: > >>> you're confusing the shell's "is this file executable" check with >>> the loader's "can I execute this file" check: >>> >>> $ export PATH=.:$PATH >>> $ dd if=/dev/zero of=ls count=1 >>> 1+0 records in >>> 1+0 recor

Re: Need Simple Way To Determine If File Is Executable

2006-12-21 Thread Sebastian 'lunar' Wiesner
Fredrik Lundh <[EMAIL PROTECTED]> schrieb > Sebastian 'lunar' Wiesner wrote: > > no, I'm showing that a local file marked as executable overrides a > shared one, even if the local file isn't actually an executable. > >>> Only if you have your system set up badly. The current direct

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Fredrik Lundh
Sebastian 'lunar' Wiesner wrote: no, I'm showing that a local file marked as executable overrides a shared one, even if the local file isn't actually an executable. >>> >>> Only if you have your system set up badly. The current directory >>> should not be in the search path, and it esp

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Sebastian 'lunar' Wiesner
Fredrik Lundh <[EMAIL PROTECTED]> schrieb > Paul Arthur wrote: > >>> no, I'm showing that a local file marked as executable overrides a >>> shared one, even if the local file isn't actually an executable. >> >> Only if you have your system set up badly. The current directory >> should not be in

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Fredrik Lundh
Paul Arthur wrote: >> no, I'm showing that a local file marked as executable overrides a >> shared one, even if the local file isn't actually an executable. > > Only if you have your system set up badly. The current directory should > not be in the search path, and it especially shouldn't have

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Sebastian 'lunar' Wiesner
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> schrieb > In <[EMAIL PROTECTED]>, Sebastian 'lunar' Wiesner > wrote: > >> Gabriel Genellina <[EMAIL PROTECTED]> schrieb >>> A similar function exists on Linux too. But even if a file has the >>> right file format, if it does not have the execute bit se

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Fredrik Lundh
Sebastian 'lunar' Wiesner wrote: >> you're confusing the shell's "is this file executable" check with the >> loader's "can I execute this file" check: >> >> $ export PATH=.:$PATH >> $ dd if=/dev/zero of=ls count=1 >> 1+0 records in >> 1+0 records out >> $ ls -l ls >> -rw-rw-r-- 1 slab slab 512 De

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Sebastian 'lunar' Wiesner wrote: > Gabriel Genellina <[EMAIL PROTECTED]> schrieb >> A similar function exists on Linux too. But even if a file has the >> right file format, if it does not have the execute bit set, won't run. >> And you could set that bit on a JPG image too

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Sebastian 'lunar' Wiesner
Fredrik Lundh <[EMAIL PROTECTED]> schrieb > Sebastian 'lunar' Wiesner wrote: > >> No, they aren't! Try this: > > you're confusing the shell's "is this file executable" check with the > loader's "can I execute this file" check: > > $ export PATH=.:$PATH > $ dd if=/dev/zero of=ls count=1 > 1+0 rec

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Fredrik Lundh
Sebastian 'lunar' Wiesner wrote: > No, they aren't! Try this: you're confusing the shell's "is this file executable" check with the loader's "can I execute this file" check: $ export PATH=.:$PATH $ dd if=/dev/zero of=ls count=1 1+0 records in 1+0 records out $ ls -l ls -rw-rw-r-- 1 slab slab 5

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Sebastian 'lunar' Wiesner
Tim Roberts <[EMAIL PROTECTED]> schrieb > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > >>On 16 dic, 04:47, Tim Roberts <[EMAIL PROTECTED]> wrote: >>> > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH >> >>>This will tell you that "x.exe" is executable, even if "x.exe" >>>contains >>>

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Sebastian 'lunar' Wiesner
Gabriel Genellina <[EMAIL PROTECTED]> schrieb > On 17 dic, 19:21, "Roger Upole" <[EMAIL PROTECTED]> wrote: > >> >> > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH >> >> >>This will tell you that "x.exe" is executable, even if "x.exe" >> >>contains >> >> nothing but zeros. >> >> > Isn't

Re: Need Simple Way To Determine If File Is Executable

2006-12-18 Thread Tim Daneliuk
Gabriel Genellina wrote: > At Monday 18/12/2006 13:41, Tim Daneliuk wrote: > >> I was working on a new release and wanted to add file associations >> to it. That is, if the user selected a file and double clicked or >> pressed Enter, I wanted the following behavior (in the following >> steps, "ty

Re: Need Simple Way To Determine If File Is Executable

2006-12-18 Thread Gabriel Genellina
At Monday 18/12/2006 13:41, Tim Daneliuk wrote: I was working on a new release and wanted to add file associations to it. That is, if the user selected a file and double clicked or pressed Enter, I wanted the following behavior (in the following steps, "type" means nothing more than "a file who

Re: Need Simple Way To Determine If File Is Executable

2006-12-18 Thread Tim Daneliuk
Gabriel Genellina wrote: > On 17 dic, 19:21, "Roger Upole" <[EMAIL PROTECTED]> wrote: > > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH This will tell you that "x.exe" is executable, even if "x.exe" contains nothing but zeros. >>> Isn't the same with any other recipe, porta

Re: Need Simple Way To Determine If File Is Executable

2006-12-18 Thread Gabriel Genellina
On 17 dic, 19:21, "Roger Upole" <[EMAIL PROTECTED]> wrote: > >> > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH > > >>This will tell you that "x.exe" is executable, even if "x.exe" contains > >> nothing but zeros. > > > Isn't the same with any other recipe, portable or not? Unless the OS

Re: Need Simple Way To Determine If File Is Executable

2006-12-17 Thread Roger Upole
Tim Daneliuk wrote: > Roger Upole wrote: >> Gabriel Genellina wrote: >>> On 16 dic, 04:47, Tim Roberts <[EMAIL PROTECTED]> wrote: > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH This will tell you that "x.exe" is executable, even if "x.exe" contains nothing but zeros. >>> Is

Re: Need Simple Way To Determine If File Is Executable

2006-12-17 Thread Tim Daneliuk
Roger Upole wrote: > Gabriel Genellina wrote: >> On 16 dic, 04:47, Tim Roberts <[EMAIL PROTECTED]> wrote: os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH >>> This will tell you that "x.exe" is executable, even if "x.exe" contains >>> nothing but zeros. >> Isn't the same with any other

Re: Need Simple Way To Determine If File Is Executable

2006-12-17 Thread Roger Upole
Gabriel Genellina wrote: > On 16 dic, 04:47, Tim Roberts <[EMAIL PROTECTED]> wrote: >> > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH > >>This will tell you that "x.exe" is executable, even if "x.exe" contains >> nothing but zeros. > > Isn't the same with any other recipe, portable or n

Re: Need Simple Way To Determine If File Is Executable

2006-12-17 Thread Tim Roberts
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >On 16 dic, 04:47, Tim Roberts <[EMAIL PROTECTED]> wrote: >> > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH > >>This will tell you that "x.exe" is executable, even if "x.exe" contains >> nothing but zeros. > >Isn't the same with any other r

Re: Need Simple Way To Determine If File Is Executable

2006-12-16 Thread Gabriel Genellina
On 16 dic, 04:47, Tim Roberts <[EMAIL PROTECTED]> wrote: > > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH >This will tell you that "x.exe" is executable, even if "x.exe" contains > nothing but zeros. Isn't the same with any other recipe, portable or not? Unless the OS actually tries to

Re: Need Simple Way To Determine If File Is Executable

2006-12-15 Thread Tim Roberts
Tim Daneliuk <[EMAIL PROTECTED]> wrote: > >This seems to work, at least approximately: > > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH > >It probably does not catch every single instance of something >that could be considered "executable" because this is a sort >of fluid thing in Window

Re: Need Simple Way To Determine If File Is Executable

2006-12-15 Thread Tim Daneliuk
Tim Golden wrote: > [Tim Daneliuk] >> I have a program wherein I want one behavior when a file is >> set as executable and a different behavior if it is not. Is >> there a simple way to determine whether a given named file is >> executable that does not resort to all the lowlevel ugliness >> of os

Re: Need Simple Way To Determine If File Is Executable

2006-12-15 Thread Tim Golden
[Tim Daneliuk] > I have a program wherein I want one behavior when a file is > set as executable and a different behavior if it is not. Is > there a simple way to determine whether a given named file is > executable that does not resort to all the lowlevel ugliness > of os.stat() AND that is porta

Re: Need Simple Way To Determine If File Is Executable

2006-12-14 Thread Gabriel Genellina
At Thursday 14/12/2006 19:21, John McMonagle wrote: > I have a program wherein I want one behavior when a file is set as executable > and a different behavior if it is not. Is there a simple way to determine > whether a given named file is executable that does not resort to all the > lowlevel

Re: Need Simple Way To Determine If File Is Executable

2006-12-14 Thread John McMonagle
Tim Daneliuk wrote: > I have a program wherein I want one behavior when a file is set as executable > and a different behavior if it is not. Is there a simple way to determine > whether a given named file is executable that does not resort to all the > lowlevel ugliness of os.stat() AND that is po