[Win32utils-devel] Problems with win32-dir and create_junction

Heesob Park phasis at gmail.com
Thu Oct 2 09:58:55 EDT 2008


Hi,

2008/10/2 Daniel Berger <djberg96 at gmail.com>:
> Hi,
>
> I don't know when this started happening, but I can't win32-dir tests to
> pass any more for the create_junction method.
>
> It looks like the junction is created, but it's not valid. Here's the
> results of the tests on Vista using the latest from CVS:
>
> Started
> ....................E.E.................................
>
> Finished in 0.477 seconds.
>
>  1) Error:
> test_create_junction_ascii(TC_Win32_Dir):
> Errno::EINVAL: Invalid argument - test_to_directory
>    ./test/test_dir.rb:38:in `open'
>    ./test/test_dir.rb:38:in `entries'
>    ./test/test_dir.rb:38:in `test_create_junction_ascii'
>
>  2) Error:
> test_create_junction_unicode(TC_Win32_Dir):
> Errno::EINVAL: Invalid argument - Ελλάσ
>    ./test/test_dir.rb:44:in `open'
>    ./test/test_dir.rb:44:in `entries'
>    ./test/test_dir.rb:44:in `test_create_junction_unicode'
>
> 56 tests, 111 assertions, 0 failures, 2 errors, 0 pendings, 0 omissions, 0
> notifications
> rake aborted!
> Command failed with status (1): [C:/Ruby/bin/ruby -w -Ilib
> "C:/Ruby/lib/rub...]
>
> (See full trace by running task with --trace)
>
> Any ideas?
>
It is due to the change of multi_to_wide method.
Trailing \0's and wide_string.size mismatch problem.

Modify line#111 of dir.rb
   wide_string = multi_to_wide(buf_target)
To
   wide_string = multi_to_wide(buf_target)[0..-3]
works for me in case of ascii junction.

In case of the unicode, more work is needed.

Regards,

Park Heesob


More information about the win32utils-devel mailing list