Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Dave Korn" To: "'cygwin'" Subject: RE: cp doesnot copy in certain cases of slash (\) Date: Wed, 25 Aug 2004 13:38:59 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <412A437D.2040605@alltel.net> Message-ID: X-OriginalArrivalTime: 25 Aug 2004 12:38:59.0187 (UTC) FILETIME=[7E513C30:01C48AA0] > Koduru, Seshasai wrote: > > >Hi, > > > >Following is the test case: > >------------START------------- > >C:\>c:\cygwin\bin\mkdir.exe -p c:\src c:\dst > > > >C:\>c:\cygwin\bin\touch.exe c:\src\newfile > > > >C:\>c:\cygwin\bin\cp.exe c:\src\newfile c:\dst > >/usr/bin/cp: cannot create regular file > `c:\\dst/c:\\src\\newfile': No > >such file or directory As you can see, it's trying to build the full path to the destination file by appending what it thinks is the filename-part of the source path to the supplied destination path. Unfortunately, because it only knows about one kind of path separator, it thinks the entire source path is in fact one filename component with no path and appends the entire thing, thus coming up with the nonsensical mess which isn't a valid name for the open function. > -----Original Message----- > From: cygwin-owner On Behalf Of Ken Dibble > Sent: 23 August 2004 20:20 > Given that you are using cygwin binaries which assume a POSIX > environment in a DOS environment, > I am surprised that it ever works. Well, cygwin does its best to silently handle dos-style paths with the wrong kind of slashes in them, and so a lot of commands can accept them as well; as long as they just pass the filename/path unmodified to the library open (..) function all is well. It only goes wrong when a non-dos-path-aware unix program tries to do path manipulation - splitting and joining - because the cygwin library can't help out there. cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/