|
|
Problem using find on win32
Hi,
I am trying to find the following file ( where version number can vary)
org.eclipse.equinox.lanucher_x.x.x.jar in "C:\\Tools\\SDS\\plugins\\"
sub equinox (){
$jar = $File::Find::name if /\Aorg\.eclipse\.equinox\.launcher_.*\.jar\z/;
}
my $equinoxDir = "C:\\Tools\\SDS\\plugins\\
find (\&equinox,$equinoxDir);
I can see that the path for files & directories found using find becomes:
/mydir/file1.txt
/mydir/file2.txt
and so on.
So the full path becomes:
C:\\Tools\\SDS\\plugins\\/mydir
which does not work.
How can make paths be the same.
--
Mikael Petterson
Software Designer
Ericsson AB, Stockholm, Sweden
Visiting address: Isafjordsgatan 15, Kista
Phone: +46 70 2673044
E-mail: mikael.petterson@ericsson.com
|
|
0
|
|
|
|
Reply
|
Mikael
|
2/25/2008 3:48:16 PM |
|
On Feb 25, 4:48 pm, Mikael Petterson <mikael.petter...@ericsson.com>
wrote:
> my $equinoxDir = "C:\\Tools\\SDS\\plugins\\
I would recommend to use forward slashes (/) instead of back slashes
(\) wherever possible.
my $equinoxDir = "C:/Tools/SDS/plugins/";
It's easier on the eyes (avoids "\\", "leaning toothpicks") and it
works even on Windows (unless you shell out to the command line prompt
with system(), in which case you are forced to use back slashes)
> find (\&equinox,$equinoxDir);
>
> I can see that the path for files & directories found using find becomes:
>
> /mydir/file1.txt
> /mydir/file2.txt
>
> and so on.
I observe: File::find has returned forward slashes.
> So the full path becomes:
>
> C:\\Tools\\SDS\\plugins\\/mydir
>
> which does not work.
You have a mix of forward and backward slashes, which might be the
reason for your problem.
If you use forward slashes to start with, your full path will be:
$fullpath = "C:/Tools/SDS/plugins//mydir";
Notice that there is only one type of slash (forward slash).
The double forward slash between "plugins" and "mydir" gets
automatically resolved into a single slash, no need to resolve that,
really. This should work perfectly, even on Windows.
However, should you wish to resolve it for other reasons, or just
because it looks better, then you could use:
$fullpath =~ s{/+}{/}g;
--
Klaus
|
|
0
|
|
|
|
Reply
|
Klaus
|
2/25/2008 4:30:23 PM
|
|
|
1 Replies
81 Views
(page loaded in 0.035 seconds)
Similiar Articles: Problem using COM automation server out of .net-Application - comp ...... is Nisse and I am new to MATLAB Central, nevertheless I hope to find answers for my problems here. ... egal > Assembly Version: 1.0.0.0 > Win32 Version: 1.0.0.0 ... where is win32.hhf? - comp.lang.asm.x86... it, it's fully functional, but as I tried to use #include("win32.hhf ... instruction I get an error > message "cannot open win32.hhf", I searched to solve this problem ... programming device driver for win32 - comp.lang.asm.x86... language, and i am now verey interest to programming device driver for win32 using HLA ... defs missing, but adding the missing ones you need usually isn't much of a problem ... Getting a hConsoleOutput handle - comp.os.ms-windows.programmer ...... And at this point in the thread we find a problem statement ... comp.os.ms-windows.programmer.win32 596 articles. ... How to use Write Combining buffers? - comp.lang.asm ... Key press question - comp.lang.perl.misc... command in the Win32-GuiTest module. And I was unable to determine how to use it for two ... them, use them, and your problem is solved; > if you are using them, and find ... Dev-C++ and openGL - linker problem and simple how to - comp ...It works well if the type is set to Win32 GUI. That just adds a ... and bloodshed's Dev-C++ IDE - opengl Dev-C++ and openGL - linker problem and simple how to I'm using ... NASM - VC++ Linking Problems - comp.lang.asm.x86... _myfunc: > ... > ret > > nasm -f win32 mymodule ... it may work with NASM if I can get Watcom to use NASM. To find ... However, I have had the following problems with WASM ... Query: How to add a checkbox control in Tab [ Win 32 project, None ...... over net shows me only MFC and .Net solutions, but could not find anything related to plain Win32 ... You can add and delete tabs at runtime no problem - there's an API ... Getting directory sizes on win32 - comp.lang.perl.miscproblem with mixed c and fortran code - comp.lang.fortran ... One is a fixed-size ... string> using namespace std; __int64 TransverseDirectory(string path) { WIN32_FIND ... PDF OLE Server - comp.text.pdfProblem with IE automation in Perl - comp.lang.perl.misc ..... possibly going wrong: use strict; use Win32::OLE ... Problem using COM automation server out of .net ... Encryption using the Win32 Crypto API - CodeProjectHow to encrypt using the Win32 Crypto API.; Author ... char pointer to avoid future problems with casts when the encryption is performed. Finally, when using the Win32 Crypto ... Generic Host Process Svchost.exe Problem SolutionIf True Sword shows that you do not have svchost.exe virus, then use our Svchost Fix Wizard to solve generic host win32 services problem and all other similar errors of ... 7/5/2012 11:03:47 AM
|
|
|
|
|
|
|
|
|