You are here

Specification for non-application-specific directories?

4 posts / 0 new
Last post
adamk
adamk's picture
Offline
Last seen: 13 years 7 months ago
Joined: 2008-06-10 23:21
Specification for non-application-specific directories?

Is there a specification available for the discovery of the locations of user-owned content, or will I have to just wing it and blindly hope that they exist at Driver:\Documents\Music etc etc.

Some quick background...

As of Perl 5.10.0 there is now in-principle support for "relocation" (moving the Perl install location from one place to another).

Funded by a Perl Foundation Development Grant over the next three months I will be working on adding deep portability to Strawberry Perl, extending an experimental proof of concept that I did a few months ago.

Although not only targeted at the PortableApps.com framework, it is likely to be the first larger framework that gets integrated with (once the basics for portability work).

While most of the information I need is well specified, I'm stuck when it comes to porting over File::HomeDir, which is used by Perl programs to do discovery of directories like "My Documents" across multiple operating systems.

While it appears that I can map most of the resources tracked by File::HomeDir to their PortableApps.com equivalents, I can find any documentation to assert they will always exist in the same location as on my personal install of the suite.

For example, could they be different in future versions of PortableApps? Could they be different for different languages? (Which is the case on Windows)

I'd be much happier if I wasn't flying blind here, and could implement the File::HomeDir driver code directly from a specification.

Thanks for your time

John T. Haller
John T. Haller's picture
Online
Last seen: 57 min 11 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Environment Variables

The next platform release will have the following environment variables you can check: PortableApps.comDocuments, PortableApps.comMusic, PortableApps.comVideos, PortableApps.comPictures. These can be different depending on the language the user is using (X:\Dokumente for German users, for instance).

As a fallback for users not using the platform, you can check for the existence of X:\Documents where X is your current drive letter if you'd like.

Oh and welcome to PortableApps.com Smile

Sometimes, the impossible can become possible, if you're awesome!

adamk
adamk's picture
Offline
Last seen: 13 years 7 months ago
Joined: 2008-06-10 23:21
Further questions

Can you provide some further details?

For example, what is the lifetime of these environment variables?

Do they exist during the period that the drive is plugged in? Or do they only exist if a menu item is clicked?

Will they be injected into the registry environment settings, or just transient in the current working environment (%ENV in Perl)...

John T. Haller
John T. Haller's picture
Online
Last seen: 57 min 11 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Platform Lifetime

They're set by the Platform as it starts. They're inherited by all processes launched by the Platform. Not registry wide. Closer to the current working environment.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments