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 the same with any other recipe, portable or not? Unless the >> > OS actually tries to load and examine the file contents, which the >> > OS's I'm aware of, don't do. >> >> On windows, you can use win32file.GetBinaryType to check if a file is >> actually a binary executable. > > 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 - and nothing good would > happen, I presume.
Really? I don't think so. Afaik on Linux executable binary files need an ELF header. [EMAIL PROTECTED]:15:43] >> ~/Bilder --> chmod a+x VM-Background.png [EMAIL PROTECTED]:15:46] >> ~/Bilder --> ./VM-Background.png bash: ./VM-Background.png: cannot execute binary file As you can see, binary files without such a header are not executed... Bye lunar -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) -- http://mail.python.org/mailman/listinfo/python-list