Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have the following requirement:
Do some work in any directory the codes are called. However, if the pwd is C:\, don't do the work there.
So, I've come out with the following program:
use Cwd; if (lc(cwd()) eq 'c:/') { print "I'm not working on this directory!\n"; } else { print "I'll work on this directory!\n"; } end;
However, there's a loophole here. If the user subst's C:\ with Z:\, and calls the codes from Z:\, it'll still run. It is not supposed to run, because Z:\ is effectively C:\.
Is there anyway to work around this subst, or even mapped drives?
Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Real Path Name
by bellaire (Hermit) on Mar 09, 2009 at 12:58 UTC | |
by Anonymous Monk on Mar 09, 2009 at 17:48 UTC | |
|
Re: Real Path Name
by jethro (Monsignor) on Mar 09, 2009 at 11:22 UTC | |
by Anonymous Monk on Mar 09, 2009 at 11:31 UTC |