I have some strong concerns about the semantics of FileSystem on MS
Windows treating '\directory' as a relative path rather than an absolute
path.
For example currently...
'/tmp/test.txt' asFileReference fullName
--> 'C:\Users\Ben\AppData\Roaming\Pharo\images\30790\tmp\test.txt'
when it _should_ go...
'/tmp/test.txt' asFileReference fullName
--> 'C:\tmp\x.txt'
This seems to be by design per '\test\bar' below...
WindowsStoreTest>>testAbsolutePath
#('c:\' 'C:\temp' 'A:\temp\test') do: [:each |
self assert: (WindowsStore current pathFromString: each)
isAbsolute ]
WindowsStoreTest>>testRelativePath
#('a' 'bin\foo' 'temp\test' '\test\bar') do: [:each |
self assert: (WindowsStore current pathFromString: each)
isRelative ]
However taking as reference the Windows Command Shell (cmd.exe)...
(1) C:\> mkdir \a\b\a\c
(2) C:\> cd a
(3) C:\a> cd b
(4) C:\a\b> cd \a
(5) C:\a>
observe that after 'cd \a' (4) the working directory becomes absolute
'C:\a' rather than relative 'C:\a\b\a' .
Microsoft defines [1] a file name is RELATIVE to the current directory
if it DOES NOT begin with:
* A single backslash, for example, "\directory" or "\file.txt". This is
also referred to as an ABSOLUTE path.
Indeed all Windows applications I know operate this way. Using different
semantics is a bug.
[1]
http://msdn.microsoft.com/en-us/library/aa365247.aspx#fully_qualified_vs._relative_paths
What are your thoughts?
cheers -ben