Subject: RE: Removing dependencies of the Cygnus shell for command usage i n NT Shells.
From: Aaron Wood <[email-masked]>
To: [email-masked]
Cc: "'Larry Hall (RFK Partners, Inc)'" <[email-masked]>
Date: Thu, 24 Aug 2000 11:56:22 -0700

-----Original Message-----
From: Larry Hall (RFK Partners, Inc) [mailto:[email-masked]]
Sent: Wednesday, August 23, 2000 10:03 AM
To: Aaron Wood
Subject: RE: Removing dependencies of the Cygnus shell for command usage
i n NT Shells.

At 12:49 PM 8/23/2000, you wrote:

>-----Original Message----- 
>From: Larry Hall (RFK Partners, Inc)
[<mailto:[email-masked]>mailto:[email-masked]] 
>Sent: Wednesday, August 23, 2000 9:39 AM 
>To: Aaron Wood 
>Subject: Re: Removing dependencies of the Cygnus shell for command usage 
>in NT Shells. 
>
>At 12:27 PM 8/23/2000, you wrote: 
> >Hi all, 
> > 
> >I've got a bit of an advanced question.... 
> > 
> >Is it possible to recompile a given command like df to a standard NT
command 
> >shell?  What I want to do is run df from an NT shell, receive the hard
drive 
> >info as the result and be able to push/pipe the command to an text file. 
> > 
> >If not, does anyone know of dependency (DLL, registry, etc.) free Unix 
> >command ports to NT? 
> > 
> > 
> >Thanks! 
> > 
> >Aaron Wood 
> >Systems Engineer 
> >Safeharbor.com 
> > 
>
>What do you want?  Just a version of df that builds without Cywgin?
There's 
>at least one out there.  I believe there was even one posted to this list 
>years ago.  And actually, its not that hard to change the source to call
the 
>right Win32 API to make the one that comes with the fileutils package work.

>Is that what you want?  You know the Cygwin df runs from the NT shell if 
>cygwin1.dll is in the path, right? 
>
>---------------------------------------- 
>
>Hi Larry, 
>
>Actually I did not know that.  I'm a bit of a newbie to creating unique
solutions such as this.  Are there any references that I can check out so
that I can make the fileutils work independently of the cywgin?
>
>I'm looking for simple Unix commands that I can use within an NT shell.  I
used to contract for M$ and thanks to the Unix gurus there.  I had access to
tons of ported commands so that you could literally turn your MS box into a
Unix box (if you wanted).  I'm looking for something along those lines.
Also, I'd like to be able to take some commands from Unix that NT/Win2k/OS
resource Kits don't have and place them on various production servers for
monitoring and scripting automated tasks.
>
>Thanks! 
>
>Aaron Wood 
>Systems Engineer 
>Safeharbor.com 
><http://www.safeharbor.com>http://www.safeharbor.com 

OK, so you're looking for various UNIX style tools.  Should I assume that 
those that come with Cygwin are not adequate?  Most of the GNU tools have
ports to vanilla Win32.  Just get the package and build them with VC++
(or probably whatever compiler you like.)  I'm sure you can find prebuilts
around too if you do a web search.  I've run across them before (even some
of the addresses have been posted to this list) but I don't recall them
offhand.

I don't think there are any specific pointers for "porting" df to Win32.
As I recall last time I looked at it, Cygwin was using volume and drive
space Win32 calls to provide the information that df needed to do its 
work (although these calls would be made in the Cygwin DLL so you'd need
to explicitly move them into the df code to decouple it from Cygwin.)  Of
course, you have to keep in mind that if you're using GNU as the basis for
your utilities, you have to follow the GNU public license if you distribute
them.  So long as that's not a problem, I'd say check out the GNU stuff and
build and use what you need!

-------------------------

Hi all,

I started experimenting with separating the df and mount commands from the
cygwin shell (along with the cygwin1.dll) and there's one thing that needs
to be noted in addition to move of files and the addition of the file's path
to the system (the PATH)...the mount table needs to be noted in the
registry.

According to...

http://sources.redhat.com/cygwin/cygwin-ug-net/using.html#MOUNT-TABLE

...and some research on my part...there's two places in the registry that
these commands read from.....

HKLM/Software/Cygnus Solutions/Cygwin/mounts v2

and

HCU/Software/Cygnus Solutions/Cygwin/mounts v2

Since the HKEY_LOCAL_MACHINE entry looks to mount system wide settings such
as the default directories for the cygwin default install and the
HKEY_Current_User seem to be whatever the user defines for the session.
Since all that I wanted was an output of the disks mounted and the space
available I deleted all of the Cygwin 'default' drive mounts and added the
following info.....you can add drives (Networked or not) using this cookie
cutter approach.

The following below is an example of a registry export of some sample
drives.

REGEDIT4

[HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2]
"cygdrive prefix"="/cygdrive"
"cygdrive flags"=dword:00000020

[HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/c]
"native"="c:"
"flags"=dword:00000002

[HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/d]
"native"="d:"
"flags"=dword:00000002

[HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/e]
"flags"=dword:00000002
"native"="e:"

[HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/f]
"flags"=dword:00000002
"native"="f:"

Cheers!

Aaron Wood
Systems Engineer
Safeharbor.com