473,218 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,218 software developers and data experts.

How to open folder ?!

viktorijakup
Hi !!!

This script must open folder, and I must view empty opened folder...!!!
I work in "Far manager".

Now this script only create folder...

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

Viki
Sep 22 '08 #1
8 6332
nithinpes
410 Expert 256MB
If you want to physically open the folder (get the view of folder contents), use:
Expand|Select|Wrap|Line Numbers
  1. system("start $to_dir");  # this will open folder in win explorer
  2.  
Else, if you want to open the folder to read its contents(files) inside Perl script, use opendir() command.
Expand|Select|Wrap|Line Numbers
  1. opendir(DIR,"$to_dir") or die "failed to open:$!";
  2. while(<DIR>) { # read through contents of folder
  3.  
  4.  
Sep 22 '08 #2
Hi !!!

Thank you for answer !!!

Expand|Select|Wrap|Line Numbers
  1.      1. system("start $to_dir"); # this will open folder in win explorer  
I need the same opening folder in "Far manager".

:)


Regards !!!

Viki






If you want to physically open the folder (get the view of folder contents), use:
Expand|Select|Wrap|Line Numbers
  1. system("start $to_dir");  # this will open folder in win explorer
  2.  
Else, if you want to open the folder to read its contents(files) inside Perl script, use opendir() command.
Expand|Select|Wrap|Line Numbers
  1. opendir(DIR,"$to_dir") or die "failed to open:$!";
  2. while(<DIR>) { # read through contents of folder
  3.  
  4.  
Sep 22 '08 #3
numberwhun
3,509 Expert Mod 2GB
I don't know about anyone else, but I have no idea what "Far Manager" is and have never heard of it. If it is an external program, then that is up to you to figure out. Otherwise, please explain what your needs are a little clearer.

Regards,

Jeff
Sep 22 '08 #4
nithinpes
410 Expert 256MB
I do not know about "Far Manager" either. However, if you know of a method to open a file/folder in Far manager through command prompt, then you should be able to do it using the same command inside system() in your script.
Sep 22 '08 #5
KevinADC
4,059 Expert 2GB
I have a funny feeling he means File Manager.....
Sep 22 '08 #6
Icecrack
174 Expert 100+
hey guys,

http://www.farmanager.com/

if its in the default then its should be

Expand|Select|Wrap|Line Numbers
  1. system(`c:\program files\far\far.exe`);
Sep 23 '08 #7
KevinADC
4,059 Expert 2GB
looks like the old DOS interface I used to work with more than 15 years ago.
Sep 23 '08 #8
Icecrack
174 Expert 100+
just to help this fella out i thought ill put in some command line argv


Expand|Select|Wrap|Line Numbers
  1.  /?   This help.
  2.  /a   Disable display of characters with codes 0 - 31 and 255.
  3.  /ag  Disable display of pseudographics characters.
  4.  /8   Forces FAR to work in ANSI (non-Unicode) console.
  5.  /e[<line>[:<pos>]] <filename>
  6.       Edit the specified file.
  7.  /i   Set small (16x16) icon for FAR console window.
  8.  /p[<path>]
  9.       Search for "common" plugins in the directory, specified by <path>.
  10.  /co  Forces FAR to load plugins from the cache only.
  11.  /rc  Restore console windows settings upon exiting FAR.
  12.  /u <username>
  13.       Allows to have separate settings for different users.
  14.  /v <filename>
  15.       View the specified file. If <filename> is -, data is read from the stdin.
  16.  /x   Disable exception handling.
Sep 23 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Yuri Vorontsov | last post by:
Hallo! We have troubles (post XP SP2) to open local folders from the web application: - the web application allows users to select a local file (input type=file) - the system DOES NOT upload...
4
by: lauren quantrell | last post by:
Is there a way to open the MS Outlook address book using VBA and then be able to do something with the return value? I want users to click an icon to open the Outlook address book then when an...
4
by: Goober | last post by:
I have a dotnet web app that opens & works fine. There's another application on the same server, in a folder below the web application. Both web apps are set up as virtual directories there and...
8
by: Kenneth P | last post by:
Hi, I've had a hd crash (with proper data backup) and I wonder what way would be the best way to set up an old project with all code from a backup hd in a new vs.net2003 environment? TIA ...
4
by: santel_helvis | last post by:
Hi there, I wanna open the folder using asp.net. I am using anchor link to do that. But in href part how shall I give the location. Anyone plz help me out. Thanks in advance
0
by: Aaron | last post by:
I have two imagebuttons in my asp.net (I'm using vb.net) application. I need one of them to open a folder and one to open a file within the aforementioned folder. I am not sure which class...
4
by: g4356 | last post by:
Hi, A new baby question: I downloaded a dot net project and saved it to my local disk. When I tried to open this project, a message popped up: "Unable to open web project "test/myfirstweb"/ The...
0
by: Niyazi | last post by:
Hi, I created application that store the data in SQL SERVER that reside on network. The client also use this application to access the resources provided with application. But is the client want...
7
by: jonathandrott | last post by:
sorry newbie question probably. i'm trying to open an specific folder. open each file with in the folder individually and process each one. all the processing code has been written. i'm looking...
25
by: Andy_Khosravi | last post by:
I just recently changed my database that I'm running from a monolithic DB to a split FE/BE. The front end resides on the client machine and the BE resides on a network drive. I'm experimenting with...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.