guides:oi10:presentation_server:getshortpath_method_filesystem

GETSHORTPATH Method (FileSystem)

Converts a "normal" long path to a legacy short DOS-style short "8.3" path.

ShortPath = Exec_Method( "FILESYSTEM",   

                            "GETSHORTPATH", 

                            LongPath )
 
NameRequiredDescription
LongPathYesSpecifies the long path to convert.

The converted short path if successful, or null if the method fails. The FILEOPRESULT property may be used to obtain more details regarding the failure.

The GETSHORTPATH method is basically a wrapper around the GetShortPath Windows API function, so it is worth examining at the documentation for this on the MSDN website to get a better idea of the capabilities of this method.

 
// Use GETSHORTPATH to convert a long path

   LongPath  = "C:\Program Files\my_app"

   ShortPath = Exec_Method( "FILESYSTEM", "GETSHORTPATH", LongPath )

   

   If BLen( ShortPath ) Then

      // ShortPath should be: "C:\ Progra~1\my_app"

   End Else

      ErrorInfo = Get_Property( "FILESYSTEM", "FILEOPRESULT" )

      ErrorCode = ErrorInfo<PS_FOR_ERRORCODE$>

      ErrorText = ErrorInfo<PS_FOR_ERRORTEXT$>

   End
 
 
 

GETLONGPATH method, FILEOPRESULT property.

  • guides/oi10/presentation_server/getshortpath_method_filesystem.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1