public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* ps, test, /dev/null questions
@ 1997-09-17 11:41 Khosla, Deepak
  1997-09-17 21:44 ` Mikey
  0 siblings, 1 reply; 12+ messages in thread
From: Khosla, Deepak @ 1997-09-17 11:41 UTC (permalink / raw)
  To: 'gnu-win32@cygnus.com'

Hi,

Can anyone answer these for me - I've looked through the docs but no 
man on ps :-(

1)	ps -ef does not return all the jobs on the system. Is there a way I 
can look at all the jobs and not just the children of my session?
2)	test -w Dir returns FALSE even though I can write to the directory 
DIR
3)	I have found through some emails that people use nul: as the 
equivalent of /dev/null (in Unix). Is that accurate and corect? Is 
that dcumented anywhere?

Regards

Deepak Khosla
281-514-9234
Deepak.Khosla@compaq.com


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ps, test, /dev/null questions
  1997-09-17 11:41 ps, test, /dev/null questions Khosla, Deepak
@ 1997-09-17 21:44 ` Mikey
  0 siblings, 0 replies; 12+ messages in thread
From: Mikey @ 1997-09-17 21:44 UTC (permalink / raw)
  To: Khosla, Deepak, gnu-win32

use pview (NT resource kit)
pview95 (Platform SDK sample applications)
wintop (95 only? MS kerneltoys)

cygnus ps only shows procs for cygnus processes. (reasonable I think :).

/dev/null exists only in the mind of the cygwin.dll (and not always there)

try diff -ubB /dev/null file.c (use echo|diff -ubB - file.c or diff -urBbN ../emptydir . )
 
.\\NUL (./NUL) exists in every directory on FAT VFAT or NTFS 
(it's a system device however it's not recognized by cygwin.dll)
(see any good dos book whoops I mean dosshell95/NT, er win32? book :)

try test -w ./DIR/. && echo itshere  (the ending slash messes up stat I think)

On Wed, 17 Sep 1997 13:36:33 -0500, you wrote:

>Hi,
>
>Can anyone answer these for me - I've looked through the docs but no 
>man on ps :-(
>
>1)	ps -ef does not return all the jobs on the system. Is there a way I 
>can look at all the jobs and not just the children of my session?
>2)	test -w Dir returns FALSE even though I can write to the directory 
>DIR
>3)	I have found through some emails that people use nul: as the 
>equivalent of /dev/null (in Unix). Is that accurate and corect? Is 
>that dcumented anywhere?
>
>Regards
>
>Deepak Khosla
>281-514-9234
>Deepak.Khosla@compaq.com
>
>
>-
>For help on using this list (especially unsubscribing), send a message to
>"gnu-win32-request@cygnus.com" with one line of text: "help".
>

(jeffdbREMOVETHIS@netzone.com)
delete REMOVETHIS from the above to reply
         Mikey
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ps, test, /dev/null questions
@ 1997-09-21 12:29 Ken Cantrell
  0 siblings, 0 replies; 12+ messages in thread
From: Ken Cantrell @ 1997-09-21 12:29 UTC (permalink / raw)
  To: Sergey Okhapkin, gnu-win32, 'Khosla, Deepak'

Sergey (and others who may be interested),

>NT's built-in task manager will show you all the running processes. Do you
>know a _documented_ way to enumerate running processes on Windows NT?-)
>

There are actually a couple of different, documented, ways to do this.  You
can use EnumProcess (in PSAPI.DLL), or you can pull a list of all the running
processes out of the registry.  Using the registry is more difficult, but if
you do go that route, you can also get a list of all the threads as well,
which, to my knowledge, you can't get by using the PSAPI.DLL stuff.

If you have the MSDN, here are some links to look at for finding out more:

The Registry Interface to Performance Data in NT:
mk:@ivt:pdwbase/native/sdk/win32/pdh/src/perf1cf9.htm


How to use EnumProcess (source code example):
mk:@ivt:pdwbase/native/sdk/win32/sys/src/psap9cmr.htm

The MSDN is online ( http://www.microsoft.com/msdn ), you should be able to
figure out the online URLs from those above.   If not, let me know, and I can
find them for you.



********************************************************************
Ken Cantrell
DG Performance Modeling
x5879
kcantrel@dg.rtp.com
*** Don't forget to smile...that's why God gave us Fangs ***



-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ps, test, /dev/null questions
  1997-09-18 12:23 Khosla, Deepak
@ 1997-09-20  7:22 ` Michael Hirmke
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Hirmke @ 1997-09-20  7:22 UTC (permalink / raw)
  To: gnu-win32

Hi,

[...]
> -	Nul: works on NT, I'm not sure why, but if it is a intentional
> feature and it plans on staying, it would be a good idea to document
> it.

Uhm, NUL is a "feature" since the early DOS days and it is available on
every MS OS I know. Don't know, though, where it might be documented.

[...]
> Regards
> 
> Deepak Khosla

Bye.
Michael.
--
Michael Hirmke           | Telefon +49 (911) 557999
Georg-Strobel-Strasse 81 | FAX     +49 (911) 557664
90489 Nuernberg          | E-Mail  mh@mike.franken.de
                         | WWW     http://minimike.franken.de/
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: ps, test, /dev/null questions
  1997-09-18 23:50 Sergey Okhapkin
                   ` (2 preceding siblings ...)
  1997-09-19 19:29 ` Hilton Fernandes
@ 1997-09-19 20:10 ` Alex
  3 siblings, 0 replies; 12+ messages in thread
From: Alex @ 1997-09-19 20:10 UTC (permalink / raw)
  To: gnu-win32

On Fri, 19 Sep 1997, Sergey Okhapkin wrote:

> Khosla, Deepak wrote:
> > Thanks for all the ideas. I tried a few:
> > -	ps -eAf or any other option does not work. I guess as someone
> 
> ps command ignores any command line arguments and uses hard-coded output 
> format.
> 
> > explained, you can only see cygnus processes - not a good port IMHO.
> > Also pview is a grpahical utility AND you have to have the reosurce
> > kit! Anyway, if you have the resource kit, you can use the TLIST
> > command.
> 
> NT's built-in task manager will show you all the running processes. Do you 
> know a _documented_ way to enumerate running processes on Windows NT?-)

According to the "premium" content on Microsoft's web site
( http://premium.microsoft.com/msdn/library/techart/f365/f36c/f383/d398/sdb7c.htm )
the correct way to get a list of all the processes is to loop through all
the Window handles, and get parent processes too.  Seems kludgy to me.
Perhaps a little program is in order to monitor things and make a procfs
like system.  Or maybe have an internal method to keep track of programs
linked with cygwin.dll

- alex

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: ps, test, /dev/null questions
  1997-09-18 23:50 Sergey Okhapkin
  1997-09-19  3:22 ` Gunther Ebert
  1997-09-19 12:39 ` Lassi A. Tuura
@ 1997-09-19 19:29 ` Hilton Fernandes
  1997-09-19 20:10 ` Alex
  3 siblings, 0 replies; 12+ messages in thread
From: Hilton Fernandes @ 1997-09-19 19:29 UTC (permalink / raw)
  To: Sergey Okhapkin, Gnu-Win32; +Cc: Hilton Fernandes

On 19 Sep 97 at 10:50, Sergey Okhapkin <sos@prospect.com.ru> wrote:

> NT's built-in task manager will show you all the running processes. Do you 
> know a _documented_ way to enumerate running processes on Windows NT?-)

Hi!

I found a kind of documentation in the the MSVC 4.0 samples in the 
folder 		
	\MSDEV\SAMPLES\SDK\SDKTools\WinNT\PViewer

Here is the caput of its README.TXT

	Sample: Process Viewer

	Summary:

	The Process Viewer sample shows how to read the various bits
	of trivia and statistics from the Registry relating to the
	various threads and process hanging about on your machine.
	It also allows you to muck about with the priority of the
	processes.  There is about a third of the code present to
	do the same on a thread-by-thread basis, so if you feel
	adventurous and/or wish to learn something, feel free to
	flesh those sections out.

A good written documentation can be more enlightening than a 
well-documented code?  Yes, but as far as i could read, this one 
looks good.  Definetly better than nothing. :-)

Since it is for NT only, i could not test it in my machine, which
runs now under Win95 only. :-( 

It seems PViewer is not the same thing as PView, a utility that comes 
with MSVC and runs under Win95.

BTW, in the same directory (or folder) as PViewer there's a tlist 
folder (or directory :-) that contains -- you guessed it -- a task 
list pgm.  It contains a very interesting function GetTaskList(), 
that creates a task list.

Maybe that can help you contribute even more to the gnu-win32
project.


Best regards,
++Hilton
----
Hilton Fernandes
hfernandes@geocities.com
http://www.geocities.com/SiliconValley/Lakes/5657
URLs and help on C++ programming and Object-Oriented Design
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: ps, test, /dev/null questions
  1997-09-18 23:50 Sergey Okhapkin
  1997-09-19  3:22 ` Gunther Ebert
@ 1997-09-19 12:39 ` Lassi A. Tuura
  1997-09-19 19:29 ` Hilton Fernandes
  1997-09-19 20:10 ` Alex
  3 siblings, 0 replies; 12+ messages in thread
From: Lassi A. Tuura @ 1997-09-19 12:39 UTC (permalink / raw)
  To: Sergey Okhapkin; +Cc: gnu-win32

> NT's built-in task manager will show you all the running processes. Do you 
> know a _documented_ way to enumerate running processes on Windows NT?-)

Hmm, it is a long time I have looked into Windows interfaces, but doesn't
the debugging API provide this sort of information? 

//lat
--
Lassi.Tuura@cern.ch          There's no sunrise without a night


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: ps, test, /dev/null questions
  1997-09-18 16:47 Larry Hall
@ 1997-09-19  8:41 ` Pete Jordan
  0 siblings, 0 replies; 12+ messages in thread
From: Pete Jordan @ 1997-09-19  8:41 UTC (permalink / raw)
  To: gnu-win32

lhall@rfk.com (Larry Hall) wrote:

> I've made /dev/null a directory.  This works nicely since it never grows
> and nothing ends up in the directory.  It has worked real well for me
> and seems to be a better alternative than using a file called null in
> the /dev directory, IMHO.

I have /dev/null as a mount to \\.\NUL: here - seems to work exactly as it
should.

Pete Jordan ~ Horus Communications ~ http://www.horus.cix.co.uk/

"'Not twisted,' Salzy once said of her own passion, 'it is helical.
 That sounds better.'"
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ps, test, /dev/null questions
  1997-09-18 23:50 Sergey Okhapkin
@ 1997-09-19  3:22 ` Gunther Ebert
  1997-09-19 12:39 ` Lassi A. Tuura
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Gunther Ebert @ 1997-09-19  3:22 UTC (permalink / raw)
  To: Sergey Okhapkin; +Cc: gnu-win32

Sergey Okhapkin wrote:
> 
> > explained, you can only see cygnus processes - not a good port IMHO.
> > Also pview is a grpahical utility AND you have to have the reosurce
> > kit! Anyway, if you have the resource kit, you can use the TLIST
> > command.
> 
> NT's built-in task manager will show you all the running processes. Do you
> know a _documented_ way to enumerate running processes on Windows NT?-)
> 

There is a registry key HKEY_PERFORMANCE_DATA which contains all information
about system performance. Information about running processes is also
stored there. I don't know if there is an explicit documentation which says
'If you want to enumerate all running processes then do this or that'
but the data structures of the HKEY_PERFORMANCE_DATA key are documented.
At least the MSDN library includes the source code of the tlist utility which
shows how to deal with the HKEY_PERFORMANCE_DATA key to enumerate all
running processes.

Gunther
-- 

Gunther Ebert
iXOS Anwendungs-Software GmbH
Angerstrasse 40-42
D-04177 Leipzig

Phone : +49 341 48503-0
Fax   : +49 341 48503-99
E-mail: mailto:gunther.ebert@ixos-leipzig.de
www   : http://www.ixos-leipzig.de
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: ps, test, /dev/null questions
@ 1997-09-18 23:50 Sergey Okhapkin
  1997-09-19  3:22 ` Gunther Ebert
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Sergey Okhapkin @ 1997-09-18 23:50 UTC (permalink / raw)
  To: 'gnu-win32@cygnus.com', 'Khosla, Deepak'

Khosla, Deepak wrote:
> Thanks for all the ideas. I tried a few:
> -	ps -eAf or any other option does not work. I guess as someone

ps command ignores any command line arguments and uses hard-coded output 
format.

> explained, you can only see cygnus processes - not a good port IMHO.
> Also pview is a grpahical utility AND you have to have the reosurce
> kit! Anyway, if you have the resource kit, you can use the TLIST
> command.

NT's built-in task manager will show you all the running processes. Do you 
know a _documented_ way to enumerate running processes on Windows NT?-)

--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: ps, test, /dev/null questions
@ 1997-09-18 16:47 Larry Hall
  1997-09-19  8:41 ` Pete Jordan
  0 siblings, 1 reply; 12+ messages in thread
From: Larry Hall @ 1997-09-18 16:47 UTC (permalink / raw)
  To: Khosla, Deepak, 'gnu-win32@cygnus.com'

At 02:06 PM 9/18/97 -0500, Khosla, Deepak wrote:
>-	Sending anything to /dev/null does create a file that size (not 
>good), however if you input from it, you don't get anything (strange 
>but good)

I've made /dev/null a directory.  This works nicely since it never grows
and nothing ends up in the directory.  It has worked real well for me and 
seems to be a better alternative than using a file called null in the
/dev directory, IMHO.

Larry Hall                              lhall@rfk.com
RFK Partners, Inc.                      (781) 239-1053
8 Grove Street                          (781) 239-1655 - FAX
Wellesley, MA  02181                             

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: ps, test, /dev/null questions
@ 1997-09-18 12:23 Khosla, Deepak
  1997-09-20  7:22 ` Michael Hirmke
  0 siblings, 1 reply; 12+ messages in thread
From: Khosla, Deepak @ 1997-09-18 12:23 UTC (permalink / raw)
  To: 'gnu-win32@cygnus.com'

Thanks for all the ideas. I tried a few:
-	ps -eAf or any other option does not work. I guess as someone 
explained, you can only see cygnus processes - not a good port IMHO. 
Also pview is a grpahical utility AND you have to have the reosurce 
kit! Anyway, if you have the resource kit, you can use the TLIST 
command.
-	Nul: works on NT, I'm not sure why, but if it is a intentional 
feature and it plans on staying, it would be a good idea to document 
it.
-	Sending anything to /dev/null does create a file that size (not 
good), however if you input from it, you don't get anything (strange 
but good)
-	test -w ./DIR/. does just the same - returns false when it 
shouldn't

Regards

Deepak Khosla
281-514-9234
Deepak.Khosla@compaq.com


-----Original Message-----
From:	jeffdbREMOVETHIS@netzone.com 
[SMTP:jeffdbREMOVETHIS@netzone.com]
Sent:	Wednesday, September 17, 1997 11:44 PM
To:	Khosla, Deepak; gnu-win32@cygnus.com
Subject:	Re: ps, test, /dev/null questions

use pview (NT resource kit)
pview95 (Platform SDK sample applications)
wintop (95 only? MS kerneltoys)

cygnus ps only shows procs for cygnus processes. (reasonable I think 
:).

/dev/null exists only in the mind of the cygwin.dll (and not always 
there)

try diff -ubB /dev/null file.c (use echo|diff -ubB - file.c or diff 
-urBbN ../emptydir . )

.\\NUL (./NUL) exists in every directory on FAT VFAT or NTFS
(it's a system device however it's not recognized by cygwin.dll)
(see any good dos book whoops I mean dosshell95/NT, er win32? book :)

try test -w ./DIR/. && echo itshere  (the ending slash messes up stat 
I think)

On Wed, 17 Sep 1997 13:36:33 -0500, you wrote:

>Hi,
>
>Can anyone answer these for me - I've looked through the docs but no 
>man on ps :-(
>
>1)	ps -ef does not return all the jobs on the system. Is there a way 
I
>can look at all the jobs and not just the children of my session?
>2)	test -w Dir returns FALSE even though I can write to the directory 
>DIR
>3)	I have found through some emails that people use nul: as the
>equivalent of /dev/null (in Unix). Is that accurate and corect? Is
>that dcumented anywhere?
>
>Regards
>
>Deepak Khosla
>281-514-9234
>Deepak.Khosla@compaq.com
>
>
>-
>For help on using this list (especially unsubscribing), send a 
message to
>"gnu-win32-request@cygnus.com" with one line of text: "help".
>

(jeffdbREMOVETHIS@netzone.com)
delete REMOVETHIS from the above to reply
         Mikey

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~1997-09-21 12:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-17 11:41 ps, test, /dev/null questions Khosla, Deepak
1997-09-17 21:44 ` Mikey
1997-09-18 12:23 Khosla, Deepak
1997-09-20  7:22 ` Michael Hirmke
1997-09-18 16:47 Larry Hall
1997-09-19  8:41 ` Pete Jordan
1997-09-18 23:50 Sergey Okhapkin
1997-09-19  3:22 ` Gunther Ebert
1997-09-19 12:39 ` Lassi A. Tuura
1997-09-19 19:29 ` Hilton Fernandes
1997-09-19 20:10 ` Alex
1997-09-21 12:29 Ken Cantrell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).