This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: File format - UNIX/DOS while installing cygwin ?


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:
<>, 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

> 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.
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,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:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]