Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Locating A Users Current Remote Directory

by ferreira (Chaplain)
on Apr 12, 2007 at 20:31 UTC ( [id://609742]=note: print w/replies, xml ) Need Help??


in reply to Locating A Users Current Remote Directory

Is there a function or methodology for the user to invoke the routine, but having the routine locate OR understand where the user is running the routine from or is this even doable?
I am not 100% sure I fully understood your problem (mainly the thing about "current remote directory"), but if it is to determine the home directory of some user, this functionality is included in File::HomeDir. It may not be perfect all the time (as the documentation itself says), but it may be a good departing point.

If it fits you, probably all you have to do is

use File::HomeDir; $home = File::HomeDir->users_home('foo');

Replies are listed 'Best First'.
Re^2: Locating A Users Current Remote Directory
by brusimm (Pilgrim) on Apr 13, 2007 at 14:26 UTC
    ferreira: I'm not determining just the home directory, but the exact directory a user has navigated to, to be able to run the procedure noted and have it use the answer file in that directory. It may not even be that users own directory structure they run the procedure from.

    Here's another example: I am calling a routine:
    \u\user100\idaho\perl\functions\sort.pl But I am calling it from:
    \u\userabc\calif\files\answer\

    I want to enable an option in sort.pl to know the exact location I am in when I invoke it so it looks for an answer file at my location.

    (This whole question is brought about because some users don't want to have to type the path to their own answer files.)

    btw: Thanks Ikegami for your time.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-03-28 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found