Does DrRacket have a function that returns the Package Source path

A package source path can be entered in:
DrRacket/Package Manager/Package Source:

Would be nice if there was a function that could return the entered value.
The nearest similar function that I can find is: current-library-collection-paths

1 Like

Sorry, I'm not understanding what you're looking for. What would this function take as an input, and what would it return?

Apologies if I'm a little slow.

Hi John,
In reply to your question...
In the same way that the racket function: current-library-collection-paths returns a list of paths that have been set elsewhere, not by the function: current-library-collection-paths,
I suspect that there may already exist a function that can return the path I have manually set within DrRacket by selecting this series of menu options:
/File/Package Manager/Package Source: ".plt-scheme/4.2.1/collects/DG/"
Since I don't currently know of a function that can return the above string, I currently define a semi-global var to contain the same string and refer to that semi-global var in many of my modules. (No need for the semi-global var if I knew of a function that returned the same string.)

1 Like

It sounds like you have installed a package, perhaps named "DG", and you want the path of the package's source directory. You can get that with pkg-directory, like (pkg-directory "DG").

But that's usually not the best solution if you have Racket code that wants to refer to files relative to the enclosing module source file. A better solution is define-runtime-path and the other forms in the racket/runtime-path library.

1 Like

Hi Ryan,
I did not install a package named "DG".
My thanks for your pointers.
After working through the suggestions, I have determined that none are the sought-after function.
I am now writing a new query to help me transition to being able to use define-runtime-path and other forms in the racket/runtime-path library.