My current directory path is /a/b/c/
When I do
fname = File.path("../test.rb")
::File.absolute_path(fname)
output is: /a/b/test.rb
What I am expecting is the output something like this: /a/b/c/../test.rb
Basically I need the path of a file without normalisation of ../ and ~
Can you try File.realpath() methods. For example:
This will give you the absolute path with '..' references intact.