This is the mail archive of the
mailing list for the Cygwin project.
RE: File format - UNIX/DOS while installing cygwin ?
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Ramneek Singh <ramneek at cisco dot com>
- Cc: cygwin at cygwin dot com
- Date: Sat, 11 Sep 2004 09:33:18 -0400 (EDT)
- Subject: RE: File format - UNIX/DOS while installing cygwin ?
- References: <firstname.lastname@example.org>
- Reply-to: cygwin at cygwin dot com
Let's take them in chronological order... See below.
On Sat, 11 Sep 2004, Ramneek Singh wrote:
> -----Original Message-----
> From: Ramneek Singh [mailto:ramneek@XXXXX.XXX]
> Sent: Saturday, September 11, 2004 12:53 AM
> To: 'cygwin@XXXXXX.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:
<http://cygwin.com/cygwin-ug-net/setup-net.html>, and for more info on
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,
<http://cygwin.com/acronyms/#TMTOWTDI>. In general, binary mounts are
> 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 <http://cygwin.com/cygwin-ug-net/using-utils.html#MOUNT>, and
also look at "man mount" once you install Cygwin.
> Can this option be changed to chose the other format after cygwin is
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.
|\ _,,,---,,_ email@example.com
ZZZzz /,`.-'`' -. ;-;;,_ firstname.lastname@example.org
|,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