aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Handling unix file attributes on Windows with cygwin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Handling unix file attributes on Windows with cygwin" Watch "Handling unix file attributes on Windows with cygwin" New topic
Author

Handling unix file attributes on Windows with cygwin

Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
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?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Malathi Krishnan
Greenhorn

Joined: Apr 18, 2007
Posts: 2
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Handling unix file attributes on Windows with cygwin