[#84867] [Ruby trunk Bug#14357] thread_safe tests suite segfaults — v.ondruch@...

Issue #14357 has been reported by vo.x (Vit Ondruch).

11 messages 2018/01/15

[#84980] [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — hsbt@...

Issue #13618 has been updated by hsbt (Hiroshi SHIBATA).

10 messages 2018/01/23
[#85012] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — Eric Wong <normalperson@...> 2018/01/23

hsbt@ruby-lang.org wrote:

[ruby-core:85215] [Ruby trunk Bug#14406] File.expand_path doesn't expand tilde inside Windows home directory

From: hanmac@...
Date: 2018-01-29 09:38:47 UTC
List: ruby-core #85215
Issue #14406 has been updated by Hanmac (Hans Mackowiak).


@abotalov:
you need to call GetLongPathName https://msdn.microsoft.com/en-us/library/windows/desktop/aa364980(v=vs.85).aspx
using win32api or fiddle

the win32api would look like that:

~~~ ruby
require "tmpdir"
def get_long_win32_filename(short_name)
    require 'win32api'
    win_func = Win32API.new("kernel32","GetLongPathName","PPL","L")
    buf = 0.chr * 256
    buf[0..short_name.length-1] = short_name
    win_func.call(short_name, buf, buf.length)
    return buf.split(0.chr).first
end
p get_long_win32_filename(Dir.tmpdir)
~~~

don't know how much complicated it would be with fiddle

----------------------------------------
Bug #14406: File.expand_path doesn't expand tilde inside Windows home directory
https://bugs.ruby-lang.org/issues/14406#change-69962

* Author: abotalov (Andrei Botalov)
* Status: Rejected
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.5.0
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
TMP environment variable on Windows is set to a name that contains a tilde. `File.expand_path` doesn't currently return an expanded name. I would expect it to do so as its documentation says:
"Converts a pathname to an absolute pathname."
"The given pathname may start with a “~”, which expands to the process owner's home directory"

Example on my system:

~~~ ruby
irb(main):085:0> File.expand_path(Dir.tmpdir)
=> "C:/Users/ANDREI~1/AppData/Local/Temp"
irb(main):086:0> File.absolute_path(Dir.tmpdir)
=> "C:/Users/ANDREI~1/AppData/Local/Temp"
~~~




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next