Possible bug? POSIX paths

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible bug? POSIX paths

BGINFO for X

Hello,

After reading some documentation about PATHS, http://www.mingw.org/wiki/Posix_path_conversion

I have some problems doing a trivial "ls" with windows paths (no spaces).

I have done 5 tests:

1) Windows path one folder - It works!

$ ls -la c:\windows

ls: c:windows/CSC:

total 23080

drwxr-xr-x 64 k Administradores 28672 Jan 18 19:48 .

drwxsr-xr-x 22 k Administradores 16384 Feb 6 16:38 ..

-rw-r--r-- 1 k Administradores 5242934 Nov 5 08:30 BGInfo.bmp

...



2) POSIX path one folder -> It works!

$ ls -la c:/windows

ls: c:/windows/CSC:

total 23080

drwxr-xr-x 64 k Administradores 28672 Jan 18 19:48 .

drwxr-xr-x 22 k Administradores 16384 Feb 6 16:38 ..

-rw-r--r-- 1 k Administradores 5242934 Nov 5 08:30 BGInfo.bmp

...


3) POSIX path subfolder (ADAM) -> It works!

$ ls -la c:/windows/ADAM

total 3384

drwxr-xr-x 37 k Administradores 4096 Mar 20 2012 .

drwxr-xr-x 64 k Administradores 28672 Jan 18 19:48 ..

-rwxr-xr-x 2 k Administradores 253952 Nov 20 2010 ADSchemaAnalyzer.exe

...


4) Windows path subfolder (ADAM) -> It doesn't works!

$ ls -la c:\windows\ADAM

ls: c:windowsADAM: No such file or directory


5) Windows path subfolder (ADAM) QUOTED -> It works!

$ ls -la "c:\windows\ADAM"

total 3384

drwxr-xr-x 37 k Administradores 4096 Mar 20 2012 .

drwxr-xr-x 64 k Administradores 28672 Jan 18 19:48 ..

-rwxr-xr-x 2 k Administradores 253952 Nov 20 2010 ADSchemaAnalyzer.exe


My question is: Why test 4 doesn't work?

If there is only one folder, it works (test 1).

I don't understand why adding subfolders fails.

Is there any reason?

I'm doing something wrong?


Why test 5 works?

I think that quoting here is not necessary.

But In fact I don't mind if works with quotes. My real question is test 4.


Thanks a lot.






------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Mingw-msys mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mingw-msys
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug? POSIX paths

Ralf Fassel
* BGINFO for X
| 4) Windows path subfolder (ADAM) -> It doesn't works!
|
| $ ls -la c:\windows\ADAM
|
| ls: c:windowsADAM: No such file or directory
--<snip-snip>--
| My question is: Why test 4 doesn't work?

Because the backslash is the SHELL quoting character.  It is used to
escape the next character from any special meaning.  In your example,
'w' and 'A' have no special meaning, so the backslash is 'wasted'.

You need to double an unquoted backslash to get a single backslash
into the argument:
  ls -la c:\\windows\\ADAM
or quote it:
  ls -la 'c:\windows\ADAM'

HTH
R'

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Mingw-msys mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mingw-msys
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug? POSIX paths

Earnie Boyd
In reply to this post by BGINFO for X
On Fri, Feb 8, 2013 at 9:26 AM, BGINFO for X <[hidden email]> wrote:

This needs discussed at [hidden email].  Please
resend to that list.

> Hello,
>
> After reading some documentation about PATHS,
> http://www.mingw.org/wiki/Posix_path_conversion
>
> I have some problems doing a trivial "ls" with windows paths (no spaces).
>
> I have done 5 tests:
>
> 1) Windows path one folder - It works!
>
> $ ls -la c:\windows
>
> ls: c:windows/CSC:
>
> total 23080
>
> drwxr-xr-x 64 k Administradores 28672 Jan 18 19:48 .
>
> drwxsr-xr-x 22 k Administradores 16384 Feb 6 16:38 ..
>
> -rw-r--r-- 1 k Administradores 5242934 Nov 5 08:30 BGInfo.bmp
>
> ...
>
>
>
> 2) POSIX path one folder -> It works!
>
> $ ls -la c:/windows
>
> ls: c:/windows/CSC:
>
> total 23080
>
> drwxr-xr-x 64 k Administradores 28672 Jan 18 19:48 .
>
> drwxr-xr-x 22 k Administradores 16384 Feb 6 16:38 ..
>
> -rw-r--r-- 1 k Administradores 5242934 Nov 5 08:30 BGInfo.bmp
>
> ...
>
>
> 3) POSIX path subfolder (ADAM) -> It works!
>
> $ ls -la c:/windows/ADAM
>
> total 3384
>
> drwxr-xr-x 37 k Administradores 4096 Mar 20 2012 .
>
> drwxr-xr-x 64 k Administradores 28672 Jan 18 19:48 ..
>
> -rwxr-xr-x 2 k Administradores 253952 Nov 20 2010 ADSchemaAnalyzer.exe
>
> ...
>
>
> 4) Windows path subfolder (ADAM) -> It doesn't works!
>
> $ ls -la c:\windows\ADAM
>
> ls: c:windowsADAM: No such file or directory
>
>
> 5) Windows path subfolder (ADAM) QUOTED -> It works!
>
> $ ls -la "c:\windows\ADAM"
>
> total 3384
>
> drwxr-xr-x 37 k Administradores 4096 Mar 20 2012 .
>
> drwxr-xr-x 64 k Administradores 28672 Jan 18 19:48 ..
>
> -rwxr-xr-x 2 k Administradores 253952 Nov 20 2010 ADSchemaAnalyzer.exe
>
>
> My question is: Why test 4 doesn't work?
>
> If there is only one folder, it works (test 1).
>
> I don't understand why adding subfolders fails.
>
> Is there any reason?
>
> I'm doing something wrong?
>
>
> Why test 5 works?
>
> I think that quoting here is not necessary.
>
> But In fact I don't mind if works with quotes. My real question is test 4.
>
>
> Thanks a lot.
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> Mingw-msys mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mingw-msys
>



--
Earnie
-- https://sites.google.com/site/earnieboyd

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Mingw-msys mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mingw-msys