943,923 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 3174
  • Perl RSS
Sep 22nd, 2008
0

How to open directory ?!

Expand Post »
Hi !!!

This script create folder.
I need what this script create and open created folder.
What I must add in this script...??!


Perl Syntax (Toggle Plain Text)
  1. @rem = '--*-Perl-*--
  2. @echo off
  3. if "%OS%" == "Windows_NT" goto WinNT
  4. perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
  5. goto endofperl
  6. :WinNT
  7. perl -x -S %0 %*
  8. if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
  9. if %errorlevel% == 9009 echo You do not have Perl in your PATH.
  10. if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
  11. goto endofperl
  12. @rem ';
  13. #!/usr/bin/perl
  14. use warnings;
  15. use strict;
  16. use File::Path;
  17. use Cwd;
  18. use File::Copy;
  19. use File::Spec::Functions;
  20. #hardcoded
  21. my $FP = 'Y:\graphics_qs';
  22. my $TP = 'Y:\plot_db';
  23. my ($from_file, $to_file) = ($ARGV[0], $ARGV[0]);
  24. my $cwd = `cd`;
  25. chomp $cwd;
  26. my ($from_dir, $to_dir) = ($cwd, $cwd);
  27. #rename dir part
  28. $to_dir =~ s/^\Q$FP\E/$TP/;
  29. mkpath($to_dir);
  30. exit 0;
  31.  
  32. __END__
  33. :endofperl

Regards !!!

Viki
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
viktorijakup is offline Offline
8 posts
since Sep 2008
Sep 22nd, 2008
0

Re: How to open directory ?!

Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006
Sep 22nd, 2008
0

Re: How to open directory ?!

Hi !!!

Perl Syntax (Toggle Plain Text)
  1. system("start $to_dir"); # this will open folder in win explorer

But I need the same in "Far manager".

Reputation Points: 10
Solved Threads: 0
Newbie Poster
viktorijakup is offline Offline
8 posts
since Sep 2008
Sep 22nd, 2008
0

Re: How to open directory ?!

Like everyone already told you on the other forum, nobody knows what Far Manager is. I"ve never heard of it either.
Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: Is it possible to pass a subroutine to another subroutine?
Next Thread in Perl Forum Timeline: Perl SFTP Executing commands





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC