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 X-Originating-IP: [66.167.121.135] X-Originating-Email: [rkitover AT hotmail DOT com] X-Sender: rkitover AT hotmail DOT com From: "Rafael Kitover" To: Subject: RE: deleting a file ending with a dot Date: Fri, 16 Jan 2004 15:04:24 -0800 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_00B7_01C3DC42.0767EEF0" In-Reply-To: <20040116215643.GB26308@redhat.com> Message-ID: X-OriginalArrivalTime: 16 Jan 2004 23:04:37.0413 (UTC) FILETIME=[1D237550:01C3DC85] ------=_NextPart_000_00B7_01C3DC42.0767EEF0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit >-----Original Message----- >From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Christopher Faylor >Sent: Friday, January 16, 2004 1:58 PM >To: cygwin AT cygwin DOT com >Subject: Re: deleting a file ending with a dot > >On Fri, Jan 16, 2004 at 12:37:01PM -0800, Andrew DeFaria wrote: >>(It'd be nice if fuser worked under Cygwin but I realize that might be a >>significant challenge to implement). > >sysinternals has something like this so it is feasible. Don't they even >release source for some packages? Could be an interesting project. Yup, I've looked through a bunch of it, interesting stuff. http://www.sysinternals.com/ntw2k/source.shtml I got the "netstatp" package from here: http://www.sysinternals.com/ntw2k/source/tcpview.shtml To compile with Cygwin, not exactly fuser, but still interesting, patch attached. ------=_NextPart_000_00B7_01C3DC42.0767EEF0 Content-Type: application/octet-stream; name="netstatp-cygwin.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="netstatp-cygwin.patch" diff -ruN -x '*.o' -x '*.res' -x '*.exe' netstatp.orig/Makefile netstatp/Ma= kefile --- netstatp.orig/Makefile 1969-12-31 16:00:00.000000000 -0800 +++ netstatp/Makefile 2004-01-16 02:12:06.859375000 -0800 @@ -0,0 +1,15 @@ +all: netstatp.exe + +netstatp.exe: netstatp.o netstatp.res + gcc netstatp.o netstatp.res -o netstatp.exe -liphlpapi + +netstatp.o: netstatp.c netstatp.h + gcc -c netstatp.c=20 + +netstatp.res: netstatp.rc resource.h + windres -O coff netstatp.rc netstatp.res + +clean: + rm -f netstatp.exe netstatp.o netstatp.res + +.PHONY: all clean diff -ruN -x '*.o' -x '*.res' -x '*.exe' netstatp.orig/netstatp.c netstatp/= netstatp.c --- netstatp.orig/netstatp.c 2002-03-30 04:30:44.000000000 -0800 +++ netstatp/netstatp.c 2004-01-16 01:55:17.781250000 -0800 @@ -13,7 +13,14 @@ //------------------------------------------------------------ #include "windows.h" #include "stdio.h" -#include "winsock.h" + +#ifdef __CYGWIN__ + #include "netdb.h" + #include "sys/socket.h" +#else + #include "winsock.h" +#endif + #include "iprtrmib.h" #include "tlhelp32.h" #include "iphlpapi.h" @@ -376,7 +383,9 @@ { DWORD error, dwSize; WORD wVersionRequested; +#ifndef __CYGWIN__ WSADATA wsaData; +#endif HANDLE hProcessSnap; PMIB_TCPEXTABLE tcpExTable; PMIB_TCPTABLE tcpTable; @@ -408,12 +417,14 @@ // // Initialize winsock // +#ifndef __CYGWIN__ wVersionRequested =3D MAKEWORD( 1, 1 ); if( WSAStartup( wVersionRequested, &wsaData ) ) { =20 printf("Could not initialize Winsock.\n"); return -1; } +#endif =20 // // Get options diff -ruN -x '*.o' -x '*.res' -x '*.exe' netstatp.orig/netstatp.h netstatp/= netstatp.h --- netstatp.orig/netstatp.h 2002-03-26 07:44:16.000000000 -0800 +++ netstatp/netstatp.h 2004-01-16 01:55:32.250000000 -0800 @@ -55,4 +55,5 @@ typedef struct { DWORD dwNumEntries; MIB_UDPEXROW table[ANY_SIZE]; -} MIB_UDPEXTABLE, *PMIB_UDPEXTABLE; \ No newline at end of file +} MIB_UDPEXTABLE, *PMIB_UDPEXTABLE; + ------=_NextPart_000_00B7_01C3DC42.0767EEF0 Content-Type: text/plain; charset=us-ascii -- 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/ ------=_NextPart_000_00B7_01C3DC42.0767EEF0--