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 Date: Sat, 11 Sep 2004 09:33:18 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Ramneek Singh cc: cygwin AT cygwin DOT com Subject: RE: File format - UNIX/DOS while installing cygwin ? In-Reply-To: <001301c497d6$8bbd6fe0$9c7ba8c0@amer.cisco.com> Message-ID: References: <001301c497d6$8bbd6fe0$9c7ba8c0 AT amer DOT cisco DOT com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.39 Ramneek, Let's take them in chronological order... See below. On Sat, 11 Sep 2004, Ramneek Singh wrote: > -----Original Message----- > From: Ramneek Singh [mailto:ramneek AT XXXXX DOT XXX] > Sent: Saturday, September 11, 2004 12:53 AM > To: 'cygwin AT XXXXXX DOT XXX' > Subject: File format - UNIX/DOS while installing cygwin ? > > Hi, > > While installing cygwin, it asks in the wizard whether file format is > > unix or dos. > > What is this for ? This essentially determines the /mount type/ ("binary" or "text") of your Cygwin root directory (/). For more info, please read the "Setting Up Cygwin" section in the User's Guide: , and for more info on mounts: In short, the mount type determines whether the files created by Cygwin programs in "text" mode have LF (Unix) or CRLF (DOS) line endings. "Unix" is usually the right choice, unless you plan the files to be read and written by pure Windows programs (like notepad). > > I mainly am going to use cygwin for PERL. Now, all my files are > > created in unix and I just ftp them over onto the windows machine. Aha! Which ftp are you planning to be using? Are you planning to set text or binary mode? If you set text mode in a Windows-based ftp program, you'll probably need "text" (i.e., DOS) line endings. > > Since matching is used in perl script, I am wondering if some of the > > input text files will end up with some extra characters At the end of > > each line which can throw the perl matching off ? Well, perl can handle DOS line endings even on binary (Unix) mounts (with PERLIO=crlf)... It's really up to you. Some Unix programs ported to Cygwin (notably "xkbcomp" needed to run X) are broken w.r.t. text mounts, so you're better off with binary mounts anyway, but you can always change your mind later (and make it even more fine-grained -- read on). > > For example if my expected output that I am storing in a file is the > > following string: > > Output Found Correctly > > Then if I ftp such a file over from unix and expect it to work on > > windows which File format should I be selecting ? (I am using word > > boundary around the expected output). Well, as I said above, you can either use "binary" mode in ftp and select binary (Unix) mounts, or use text (DOS) mounts, or use "text" ftp mode on binary mounts with PERLIO set to "crlf". As perl hackers say, . In general, binary mounts are better. > To add to my original question: > > Once cygwin is installed, how can I check what option I had chosen for > the file format ? Yes. See , and also look at "man mount" once you install Cygwin. > Can this option be changed to chose the other format after cygwin is > installed? Yes (see how in the above links). Moreover, you can mount *a particular directory* in text mode, while leaving the rest of your system in binary mode (e.g., "mount -t -f -s c:/cygwin/home/ramneek /home/ramneek" will make your home directory a "text" mount, even if you selected binary [Unix] mount mode for the root directory ["/"]). In other words, experiment -- find out what works for you. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Happiness lies in being privileged to work hard for long hours in doing whatever you think is worth doing." -- Dr. Jubal Harshaw -- 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/