Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^7: pp macOS external file

by bliako (Abbot)
on Apr 20, 2018 at 19:23 UTC ( [id://1213274]=note: print w/replies, xml ) Need Help??


in reply to Re^6: pp macOS external file
in thread pp macOS external file

Maybe you should have a configuration file in user's home dir pointing to all your resources, read-only, like icons but also re-writable like the SQLlite file! This solves also the problem of when you want to preserve the contents of the database for the next run. An installer of some sort (can just be a shell script) will also allow you taking care of different users.

Alternatively, create a shell script which will call your perl pp file from within a certain folder which you will know that program resources (ro/rw) are located. You achieve this via a "cd" (change dir) first. Call that script instead of the pp executable from anywhere you like, it will first cd to proper dir. Firefox for example does this: 1) install resources to user dir, 2) install firefox binary and libs in system bindir, 3) create a shell script (mine is /usr/bin/firefox) which finds resources, checks things and then it calls the real firefox binary. However, that "cd" I do not like.

p.s. for joining filenames and paths in different OS, I use the portable File::Spec->catfile.

p.s. 2 in windows I often found that two bugs combined together could result in correct program flow!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1213274]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2025-12-08 23:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (88 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.