guides:programming:programmers_reference_manual:getrelativepath_method_filesystem

GETRELATIVEPATH method (Filesystem)

Resolves an absolute path to a relative one.

RelPath = Exec_Method( "FILESYSTEM",      
                       "GETRELATIVEPATH", 
                       AbsolutePath,      
                       RelativeToPath )
NameRequiredDescription
AbsolutePathYesSpecifies the absolute path to resolve.
RelativeToPathNoSpecifies the reference path for the resolution. If this parameter is null then the current directory is used.

The relative path if successful, or null if the absolute path cannot be resolved.

This method does not check if the returned relative path actually exists.

 
// Use GETRELATIVEPATH to resolve a an absolute directory to

   // the current directory

   //

   // (Assume current directory is "c:\revsoft\openinsight")

   //

   AbsPath = "c:\revsoft\my_data"

   RelPath = Exec_Method( "FILESYSTEM", "GETRELATIVEPATH", AbsPath, "" )

   

   // RelPath should be: "..\my_data"

   

   // Use GETRELATIVEPATH to resolve an absolute directory to

   // a specified reference directory

   AbsPath = "c:\my_root_dir"

   RefPath = "c:\revsoft\openinsight\apps"

   RelPath = Exec_Method( "FILESYSTEM", "GETRELATIVEPATH", AbsPath, RefPath)

   

   // RelPath should be: "\my_root_dir"
 
 
 

GETSHORTPATH method.

  • guides/programming/programmers_reference_manual/getrelativepath_method_filesystem.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1