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 Message-ID: <54470-2200210417135821817@M2W039.mail2web.com> X-Priority: 3 Reply-To: lhall AT rfk DOT com X-Originating-IP: 209.113.174.244 From: "lhall AT pop DOT ma DOT ultranet DOT com" To: mark DOT madsen AT divine DOT com, cygwin AT cygwin DOT com Subject: RE: starting a CYGWIN app from a Windows Service Date: Thu, 17 Oct 2002 09:58:21 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 X-OriginalArrivalTime: 17 Oct 2002 13:58:21.0821 (UTC) FILETIME=[40FF02D0:01C275E5] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g9HDwgx13378 You'll probably want to check out the user's guide on this. mounts only come into play if you don't specify a mode to read and write in explicitly. "user" mounts apply to a particular user. "system" mounts apply to any user. The mode specified by a mount will only be consulted if the mode of the file has not been explicitly set. There's quite a bit more to say about mounts, file modes, and how they can be set. The User's Guide has some good information on it. The email list archives hit on various specific topics, questions, rants, and issues. You can check either of these for more details if you need more data points to flesh out your overall understanding of file modes in Cygwin. Larry Original Message: ----------------- From: Madsen, Mark Mark DOT Madsen AT divine DOT com Date: Thu, 17 Oct 2002 08:16:24 -0500 To: cygwin AT cygwin DOT com Subject: RE: starting a CYGWIN app from a Windows Service Thanks Dan. Using "rt" fixed the problem for the moment. I will still need to understand exactly why there was a difference though. CYGWIN is undefined in both circumstances. What I don't understand is the "system" vs. "user" mount types. The file is on the local file system, (C:/.../file.txt) so I don't know if that applies here. -Mark -----Original Message----- From: Dan Vasaru [mailto:dvasaru AT broadpark DOT no] Sent: Wed 10/16/2002 5:09 PM To: Madsen, Mark; cygwin AT cygwin DOT com Cc: Subject: RE: starting a CYGWIN app from a Windows Service Mark, As Chris suggested, if you want consistent behaviour under cygwin, always open text files in text mode (O_TEXT or "rt"). Even better, wrt portability to Unix platforms, is to: 1. open the file in binary mode 2. be prepared to accept both CRLF- and LF-style text files (i.e. strip the CR yourself) This way, your software will always "behave" when encountering a Windows file while running on a Unix platform. Dan PS. To explain the behaviour you're seeing you have to check 4 places: value of the CYGWIN environment variable when running as a service value of the CYGWIN environment variable when running as yourself system mount types user mount types There's probably a difference in the mount mode or CYGWIN variable between the 2 cases. Dan -----Original Message----- From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com]On Behalf Of Madsen, Mark Sent: Wednesday, October 16, 2002 11:21 PM To: cygwin AT cygwin DOT com Subject: starting a CYGWIN app from a Windows Service When I run an application that uses the cygwin1.dll from either a Windows Service and then from the command line I get different results when trying to read a text file. As a Windows Service: I use fopen and fgets to read a DOS text file and the CR/LF combinations are handled properly. Meaning that I only see the single LF. Running from a DOS command line: Using the exact same executable image as above, both characters are in the buffer. What I know: Both instances use the very same DLL image. (I deleted it and both instances complain about the DLL missing.) Both instances are reading the exact same file, not two different copies. I tried working with the CYGWIN environment variable with no effect on the outcome. Any help would be greatly appreciated. Thanks, Mark -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/