On *nix systems it would return true if the executable bit is set and false if it's not. Windows doesn't really have a comparable attribute since files are "categorized" based on extension, hence .exe acting as a sort of "executable bit".<br>
<br><div class="gmail_quote">On Fri, Apr 3, 2009 at 1:36 PM, Shri Borde <span dir="ltr"><<a href="mailto:Shri.Borde@microsoft.com">Shri.Borde@microsoft.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><span style="color: rgb(31, 73, 125);">Anyone know what File.executable?
is supposed to do? For me, it always returns false. For Jim, Tomas and others,
it always returns true no matter what the file extension is. Any idea why we
might be getting different results?</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p>
<p><span style="color: rgb(31, 73, 125);">FWIW, the current IronRuby
implementation returns true if the file extension is “.exe”.</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p>
<div>
<p><span style="color: rgb(31, 73, 125);">Thanks,</span></p>
<p><span style="color: rgb(31, 73, 125);">Shri</span></p>
</div>
<p><span style="color: rgb(31, 73, 125);"> </span></p>
<div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> Shri Borde <br>
<b>Sent:</b> Thursday, April 02, 2009 3:59 PM<br>
<b>To:</b> <a href="mailto:ruby-core@ruby-lang.org" target="_blank">ruby-core@ruby-lang.org</a><br>
<b>Subject:</b> File.executable? always returns false on Windows machine</span></p>
</div>
</div><div><div></div><div class="h5">
<p> </p>
<p>On my machine, File.executable? is always returning false. I
have tried 1.8p27. I am running on a Windows Vista x86 machine. The file system
is NTFS. I can’t think of anything unusual about my machine. </p>
<p> </p>
<p>What are the semantic supposed to be? Most of the people I
have asked get a value of true for all of the statements below, even for the
File.executable? on the ttf file.</p>
<p> </p>
<p style="margin-left: 0.5in;">puts
File.exists?("C:/windows/fonts/wingding.ttf")</p>
<p style="margin-left: 0.5in;">puts
File.readable?("C:/windows/fonts/wingding.ttf")</p>
<p style="margin-left: 0.5in;">puts
File.executable?("C:/windows/fonts/wingding.ttf") # Prints false only
for me</p>
<p style="margin-left: 0.5in;"> </p>
<p style="margin-left: 0.5in;">puts
File.exists?("C:/windows/notepad.exe")</p>
<p style="margin-left: 0.5in;">puts
File.readable?("C:/windows/notepad.exe")</p>
<p style="margin-left: 0.5in;">puts
File.executable?("C:/windows/notepad.exe") # Prints false only for me</p>
<p> </p>
<p>With the 1.9 binaries, File.executable? returns true only if
the file extensions is something like .exe. Again, it always returns true for
the people I have asked.</p>
<p> </p>
<p>Thanks,</p>
<p>Shri</p>
<p> </p>
</div></div></div>
</div>
<br>_______________________________________________<br>
Ironruby-core mailing list<br>
<a href="mailto:Ironruby-core@rubyforge.org">Ironruby-core@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/ironruby-core" target="_blank">http://rubyforge.org/mailman/listinfo/ironruby-core</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Michael Letterle<br>IronRuby MVP<br><a href="http://blog.prokrams.com">http://blog.prokrams.com</a><br><br><br>