/*
This example demonstrates how to use the ResolvePath method on a
nonexistent file.
*/
NewScene( null, false );
strPath = Application.InstallationPath( siUserPath ) ;
strPath += "/Application/Plugins" ;
// On Windows the "/" slash will be replaced by "\"
Application.LogMessage( XSIUtils.ResolvePath(strPath) ) ;
if ( Platform == "Win32" ){
// Demonstrate how ResolvePath will still fix an invalid path
strBogusPath = XSIUtils.ResolvePath( "C:\\bogusfolder/foo.txt" ) ;
var fso = new ActiveXObject( "Scripting.FileSystemObject" ) ;
if ( !fso.FileExists( strBogusPath ) ) {
Application.LogMessage( strBogusPath + " does not exist" ) ;
}
} else {
Application.LogMessage( XSIUtils.ResolvePath("/var/tmp\\foo.txt") );
}
// Expected results on Windows:
//INFO : C:\users\<USERNAME>\Softimage\<VERSION>\Application\Plugins
//INFO : C:\bogusfolder\foo.txt does not exist |