Re: Taking file from current working directory
by polettix (Vicar) on May 23, 2005 at 12:31 UTC
|
Cwd should help you in a portable way.
Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')
Don't fool yourself.
| [reply] |
|
|
Thanks for the suggestion, but Cwd doesn't work on Win32 OS, as written in the CPAN testers:
http://testers.cpan.org/show/PathTools.html#PathTools-3.07
Any other ideas?
Mosh.
| [reply] |
|
|
| [reply] |
|
|
|
|
Cwd is a core module, which means it comes with perl. You already have Cwd.
cpan-testers results can't be taken at face value,
especially a vague report like http://www.nntp.perl.org/group/perl.cpan.testers/204675.
It looks like that reporter doesn't have a compiler, so there is no chance he could ever successfully build Cwd.
| [reply] |
|
|
That doesn't help at all. The OP does not what the current working directory is, so he can't cwd there.
Update: striked. Looks like I am a dumb today.
| [reply] [d/l] |
|
|
| [reply] [d/l] [select] |
Re: Taking file from current working directory
by holli (Abbot) on May 23, 2005 at 11:55 UTC
|
simple, just leave away the path part
my $listener = Net::TFTPd->new('RootDir' => 'filename',...);
| [reply] [d/l] |
|
|
Nope,
I've already tried it without success, I've got an error message:
"Cannot create listener. RootDir '1.txt' is not a valid directory name
Any other ideas ?
I need somehow to write the current working directory...
Mosh.
| [reply] |
|
|
my $listener = Net::TFTPd->new('RootDir' => './',...);
Update:
Ah, I misread the OP.
| [reply] [d/l] |
Re: Taking file from current working directory
by jpeg (Chaplain) on May 23, 2005 at 12:34 UTC
|
| [reply] |
|
|
I develop on Win32 OS, so either PWD or './' isn't relevant...
Mosh.
| [reply] |
|
|
the dot "." represents the current working directory, even on Win32. Also Perl handles both kinds of slashes transparently.
| [reply] [d/l] |
Re: Taking file from current working directory
by tlm (Prior) on May 24, 2005 at 03:22 UTC
|
use FindBin '$RealBin';
my $listener = Net::TFTPd->new(RootDir => $RealBin,...
Also, be lazy! Accept auto-quoting (before "=>"s) into your life.
| [reply] [d/l] |