it´s no final solution, i just collected what i've noticed so far ...
In the early Foxpro days there's been no CD - (C)hange (D)irectory - command. To achieve this the command 'SET DEFAULT TO <x>' was - and still is - used. The foxpro results of e.g. 'SET DEFAULT TO F:Test' are:
Code: Select all
? Set ( "Default" ) -> "F:" - same as Sys(5)
? Curdir() -> "TEST"
Code: Select all
SetDefault(F:Test)
? GetDefault() -> F:Test
Code: Select all
? CurDrive() , Sys(5) // "F:" "F:"
? curdir() // "TEST"
Code: Select all
FUNCTION SetDefault(cPathSpec AS STRING) AS STRING
SetPathArray(NULL)
IF XSharp.RuntimeState.Dialect == XSharpDialect.FoxPro
TRY
XSharp.IO.File.ClearErrorState()
Directory.SetCurrentDirectory(cPathSpec)
cPathSpec := CurDrive() // this would save the drive name only , e.g. "F:"
CATCH e AS Exception
XSharp.IO.File.SetErrorState(e)
END TRY
IF RuntimeState.FileException != NULL
THROW RuntimeState.FileException
ENDIF
ENDIF
SETSTATE STRING Set.Default cPathSpec
The question is: if the Foxpro dialect is used, what should a SetDefault("F:Test") do ? Store the given path or the drive name ?
regards
Karl-Heinz