delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/05/03/07:26:31

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-developers-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
Message-ID: <20000503122756.9530.qmail@web112.yahoomail.com>
Date: Wed, 3 May 2000 05:27:56 -0700 (PDT)
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: earnie_boyd AT yahoo DOT com
Subject: Re: /cygdrive/windows ?
To: DJ Delorie <dj AT delorie DOT com>, cygwin-developers AT sourceware DOT cygnus DOT com
MIME-Version: 1.0

Thanks, DJ.  I just wasn't getting the point of Chris' idea.  This is much
better than storing it in the registry as one could change it anyway.

Earnie.

--- DJ Delorie <dj AT delorie DOT com> wrote:
> 
> `cygpath --windir`
> 
> The only time we'd need something like this visible outside a compiled
> application is a script, and a script can use cygpath to get the
> directory path and store it.  Any compiled program can just call
> GetWindowsDirectory() itself.
> 
> Index: cygpath.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/utils/cygpath.cc,v
> retrieving revision 1.3
> diff -p -2 -r1.3 cygpath.cc
> *** cygpath.cc	2000/04/13 05:23:30	1.3
> --- cygpath.cc	2000/05/03 02:49:35
> *************** static struct option long_options[] =
> *** 36,39 ****
> --- 36,41 ----
>     { (char *) "version", no_argument, NULL, 'v' },
>     { (char *) "windows", no_argument, NULL, 'w' },
> +   { (char *) "windir", no_argument, NULL, 'W' },
> +   { (char *) "sysdir", no_argument, NULL, 'S' },
>     { 0, no_argument, 0, 0 }
>   };
> *************** Usage: %s [-p|--path] (-u|--unix)|(-w|--
> *** 49,52 ****
> --- 51,56 ----
>     -u|--unix     	print Unix form of filename\n\
>     -w|--windows  	print Windows form of filename\n\
> +   -W|--windir 	 	print `Windows' directory\n\
> +   -S|--sysdir 	 	print `system' directory\n\
>     -p|--path     	filename argument is a path\n",
>   	   prog_name);
> *************** main (int argc, char **argv)
> *** 116,119 ****
> --- 120,124 ----
>     int options_from_file_flag;
>     char *filename;
> +   char buf[MAX_PATH], buf2[MAX_PATH];
>   
>     prog_name = strrchr (argv[0], '/');
> *************** main (int argc, char **argv)
> *** 127,131 ****
>     windows_flag = 0;
>     options_from_file_flag = 0;
> !   while ((c = getopt_long (argc, argv, (char *) "hac:f:opuvw",
> long_options, (int *) NULL))
>   	 != EOF)
>       {
> --- 132,136 ----
>     windows_flag = 0;
>     options_from_file_flag = 0;
> !   while ((c = getopt_long (argc, argv, (char *) "hac:f:opSuvwW",
> long_options, (int *) NULL))
>   	 != EOF)
>       {
> *************** main (int argc, char **argv)
> *** 163,166 ****
> --- 168,183 ----
>   	  windows_flag = 1;
>   	  break;
> + 
> + 	case 'W':
> + 	  GetWindowsDirectory(buf, MAX_PATH);
> + 	  cygwin_conv_to_posix_path(buf, buf2);
> + 	  printf("%s\n", buf2);
> + 	  exit(0);
> + 
> + 	case 'S':
> + 	  GetSystemDirectory(buf, MAX_PATH);
> + 	  cygwin_conv_to_posix_path(buf, buf2);
> + 	  printf("%s\n", buf2);
> + 	  exit(0);
>   
>   	case 'h':

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

- Raw text -


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