This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: cp doesnot copy in certain cases of slash (\)


> 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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]