blog community

Welcome to blog community Sign in | Join | Help
in Search

Wouter van Vugt

This blog is no longer maintained and has moved

Package Explorer error, or one in the framework, you decide

When creating new parts using the part creating dialog you need to enter a relative path for storing the new part. Something like

/mydirectory/mypart.xml

I check whether you enter a valid path, for one it may not be absolute but relative like the one above. But when you enter the path above, you get an error stating that an absolute path is not allowed. If you enter it like the following:

mydirectory/mypart.xml

all is ok. The check is done with Path.IsPathRooted, and the documentation states:

Gets a value indicating whether the specified path string contains absolute or relative path information

And it has samples:

C:\mydir\myfile.ext  --> absolute
\\myPc\mydir\myfile --> unc path which is absolute
mydir\subdir --> relative

So, either I don't understand my Path 101 but the framework is in error here.

Published Friday, August 10, 2007 11:15 PM by wouterv
Filed under: ,

Comments

 

Erno de Weerd said:

A starting slash means ROOT (of the current drive on Windows)

No starting slash means sub folder of the current folder.

August 10, 2007 11:49 PM
 

wouterv said:

and here I go thinking that absolute paths are all about not having context.

Back to school for me....

August 11, 2007 1:27 AM
 

willemm said:

Even absolute thinking is relative.... At least for the .NET framework ;P
August 12, 2007 8:00 PM
Anonymous comments are disabled

This Blog

Syndication

News


Add to Technorati Favorites
Powered by Community Server, by Telligent Systems