Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handling unix file attributes on Windows with cygwin

 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) ClearCase repository is on a Windows 2003 server, but has unix line endings. The drive (and files) are read-only, so I have to copy the files in order to do the build.
2) Using xcopy - changes the permissions from r--r--r-- to rwx--------- and puts ^M at the end of every line which causes the *.sh files to not run.
3) Using cygwin cp - maintains the lack of ^Ms but leaves the copied files as r--r--r-- (I run run chmod 777 ./* after the cp copy)

I would like to use ant for the copy. I'm guessing that it would behave more like xcopy since it would be running on windows.
1) Maybe use the FixCRLF afterwards... Would this work on windows/cygwin?
2) Maybe use the Chmod task afterwards ... Would this work on windows/cygwin?

Does anyone here have any experience with similar issues?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34371
345
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marilyn,
I haven't done this particular thing, but I still have some thoughts .

1) FixCRLF should definitely work - that's what it's designed to do. You get to specify what format you want the result to be in, which renders the underlying operating system irrelevant.
2) Chmod is more interesting. The task calls the underlying chmod command which Windows doesn't have as such while Cygwin does. I think the best thing to do would be to try it and see what happens.
 
Malathi Krishnan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try removing ^M's within the vi editor like this -

:%s/^M//

[^ = control key + v]
[ December 26, 2007: Message edited by: Malathi Krishnan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic