[#6660] Ruby on Neko ? — Nicolas Cannasse <ncannasse@...>

Hi folks,

14 messages 2005/11/19

[#6672] testing for hardlink with "test(?-, ...)" flawed on Windows — noreply@...

Bugs item #2858, was opened at 2005-11-20 16:35

13 messages 2005/11/20

[#6684] semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...>

Hi all,

81 messages 2005/11/21
[#6685] Re: semenatics of if/unless/while statement modifiers — Mauricio Fern疣dez <mfp@...> 2005/11/22

On Tue, Nov 22, 2005 at 08:22:59AM +0900, Stefan Kaes wrote:

[#6686] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

Mauricio Fern疣dez wrote:

[#6687] Re: semenatics of if/unless/while statement modifiers — Eric Hodel <drbrain@...7.net> 2005/11/22

On Nov 21, 2005, at 4:37 PM, Stefan Kaes wrote:

[#6689] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

Eric Hodel wrote:

[#6693] Re: semenatics of if/unless/while statement modifiers — Yukihiro Matsumoto <matz@...> 2005/11/22

Hi,

[#6695] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

Yukihiro Matsumoto wrote:

[#6718] Re: semenatics of if/unless/while statement modifiers — mathew <meta@...> 2005/11/22

[#6722] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

mathew wrote:

[#6707] Re: semenatics of if/unless/while statement modifiers — "David A. Black" <dblack@...> 2005/11/22

Hi --

[#6708] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

David A. Black wrote:

[#6714] Re: semenatics of if/unless/while statement modifiers — "David A. Black" <dblack@...> 2005/11/22

Hi --

[#6717] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

David A. Black wrote:

[#6798] ruby 1.8.4 preview2 — Yukihiro Matsumoto <matz@...>

Hi,

37 messages 2005/11/30

Re: [ ruby-Bugs-2858 ] testing for hardlink with "test(?-, ...)" flawed on Windows

From: "daz" <dooby@...10.karoo.co.uk>
Date: 2005-11-21 10:43:29 UTC
List: ruby-core #6677
From: Nobu
>
> I'm not sure if this works on Win9X or not.
>
> [.. patch ..]


It fixes the bug; - I'm not sure if it should do more?

Here are some results (after patching) if they're of any help.

   # Windows 98 (4.10.2222)
   # ruby 1.9.0 (2005-10-31) [i586-bccwin32]  (+ patch)


p test(?-, 'D:\ruby\bin\ri.bat', 'D:\ruby\bin\irb.bat')        # plain files
#-> false  (expected - Was "true" before patching)

p test(?-, 'D:\RUBY\BIN\IRBBAT~1.PIF', 'D:\ruby\bin\irb.bat')  # s/c to DOS file
#-> false  ( but file1 is a shortcut to file 2 ... ? hard link ? )

#---------

# Try a link /without/ the .lnk extension
p File.exist?('D:\ruby\DfB\Win32API\winver\init.rb')   #-> false  (expected)

sc   =        'D:\ruby\DfB\Win32API\winver\init.rb.lnk'        # s/c (normal)
p [ File.exist?(sc),   File.size(sc) ]                 #->  [true, 467]  <-------#
file =        'D:\ruby\DfB\Win32API\win32module\win32\init.rb' # -> real file
p [ File.exist?(file), File.size(file) ]               #->  [true, 2597]
p test(?-, sc, file)                                           # s/c to dir
#-> false  ( but file1 is a shortcut to file 2 ... ? hard link ? )

#---------

dir_sc, dir = 'D:\ruby\SOURCE_CODE\WWW.LNK', 'E:\CVS_temp\www'
p [ File.exist?(dir_sc), File.exist?(dir) ]            #->  [true, true]
p test(?-, dir_sc, dir)                                        # s/c to dir
#-> false  ( but file1 is a shortcut to /dir/ 2 ... ? hard link ? )


.LNK & .PIF binary files are opened directly.

#=====
# Open and read 'init.rb.lnk' reads .lnk file (binary), /not/ linked-to file.
File.open(sc, 'rb') {|shcut| p shcut.read.size}        #->         467  <--------#
#=====

IMO, this behaviour is normal, for Windows.
A .LNK file is opened directly in Notepad.
SciTE editor and UltraEdit normally open directly but both have
options to redirect to open the real file, suggesting that some
extra work needs to be done in redirecting.

During a directory search I would have to use something like:
   ['.PIF','.LNK'}.include?(File.extname(sc).upcase)
 if I needed to avoid them.


Finding a .LNK target is ugly, AFAICS:
http://www.codeguru.com/Cpp/COM-Tech/shell/article.php/c1337


daz







In This Thread