delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/09/27/22:44:24

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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: Tue, 27 Sep 2005 22:44:12 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: The One <i51359 AT yahoo DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Program doesn't work when running as a service in windows
In-Reply-To: <20050928023905.9468.qmail@web33901.mail.mud.yahoo.com>
Message-ID: <Pine.GSO.4.63.0509272243090.21541@slinky.cs.nyu.edu>
References: <20050928023905 DOT 9468 DOT qmail AT web33901 DOT mail DOT mud DOT yahoo DOT com>
MIME-Version: 1.0

On Tue, 27 Sep 2005, The One wrote:

> Hi,
>
> The C program runs fine in Dos prompt or Cygwin Shell.
>  When run as a service, it's not working.  The service
> is started without error.  The program checks for
> files in a directory, if there's a file it will print
> to the network printer by calling
> fopen("//computername/printer", "w").  I'm finding out
> the when it's running as a service, fopen is returning
> NULL.

<http://cygwin.com/faq/faq.using.html#faq.using.shares>.
It also helps to check the errno after fopen returns NULL.
HTH,
	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!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019