Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Whenever I copy programming files from windows XP to Fedora 11, leading spaces are being added to a number of the lines in the files. I am using mercurial for revision control and it is coming back and telling me that all the files in the repositories have been modified because of this.
What tools are you using to create and copy the files, also to read on Linux?
It sounds like a tab char is converting to an equiv num of spaces.
Have you also allowed for the different line ending conventions?
In MS it's <CR><LF>, in *nix it's just <LF>, hence the dos2unix and unix2dos tools.
Yeah I think you are right about the tabbing changing to spaces. I use netbeans for my IDE, and I just copied them from one hard drive to another. The weird thing though is that the formatting is getting messed up before I ever open the file. Right once I copy the file to Fedora, mercurial see's a problem.
Ok I think I fixed the formatting issue. In netbeans I made the tabbed space be the same as the indent space for both windows and linux. I believe that linux reads the tabbed spaces differently.
However, mercurial is still coming back and telling me that every file has been modified, but it does not show that there are any changes in any of the files. It seems as if the binary code of the file is being changed, but its not affecting the format. Why would the binary code of the file change across platforms?
Just to let anyone know who is having this problem. I found that if you FTP your repo's from the windows machine in binary mode to a server, and then FTP them to your linux machine, it fixes this issue. Thanks to everyone that tried to help.
Whenever I copy programming files from windows XP to Fedora 11, leading spaces are being added to a number of the lines in the files.
"Programming files" are presumably "plain text" files. You'd expect them to be just that but it's a little more complicated, thanks to microsoft.
Some background:
Windows and *nix handle text files differently (a bit the same as windows chose "\" to be the separator for file paths, when the established convention was already "/").
A windows End Of Line (EOL) is CRLF
A *nix EOL is just LF
So "plain text" files from (windows) notepad have an extra character when imported to *nix.
These problems can be solved with the utilities dos2unixfilename and unix2dosfilename which convert the EOL character(s) appropriately.
I actually think that FTPing the files would be easier then going through all of my folders and trying to fix all the files. I have alot of files to keep up with, so it just seems easier to FTP the whole folder and be done with it.
Also, as I said before. I fixed the spacing issues with Netbeans. The problem Im still having is that Mercurial is saying all of my files have been modified, but they dont show any changes, which I believe nowonmai may be right about the last modified data changing. I just have no idea how I would get Mercurial to not pay attention to this, or why it would make any difference when I copy it from Windows to Linux.
Metropolis
Last edited by Metropolis; 07-31-2009 at 11:25 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.