File names as relative paths

Nov 1, 2007 at 9:44 PM

When I create a FilePathRelativeFile, it throws an ArgumentException if the path does not start with a dot. This prevents me from using just a filename as a relative path.

For example, the following will fail on the first line:

filePathRelative1 = new FilePathRelative(@"File.txt");
directoryPathAbsolute1 = new DirectoryPathAbsolute("C:\temp");
filePathAbsolute1 = filePathRelative1.GetAbsolutePathFrom(directoryPathAbsolute1);
Debug.Assert( filePathAbsolute1.Path == @"C:\temp\File.txt");

Is this an issue, or am I missing something?
Dec 14, 2008 at 2:25 PM
This is perfectly normal, you need to specify ".\File.txt" for the FilePathRelative() ctor.