Re: Getting mount stats for filesystems

2007-06-05 Thread Martin v. Löwis
> I am looking at ctypes and it might do what I need but I can't figure > out a way to convert a Python File object to a C FILE pointer (which is > the needed argument for getmntent). > > Any ideas? I think you are supposed to pass the pointer to getmntent that you obtained from setmntent (likely

Re: Getting mount stats for filesystems

2007-06-05 Thread Mitko Haralanov
On Tue, 05 Jun 2007 21:32:21 +0200 "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > You could try to invoke getmntent(3). I'm not aware of a Python wrapper > for it, so you either try to write one yourself in C, or use ctypes to > write it in Python. I am looking at ctypes and it might do what I ne

Re: Getting mount stats for filesystems

2007-06-05 Thread Martin v. Löwis
Mitko Haralanov schrieb: > On Tue, 05 Jun 2007 20:14:01 +0200 > "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> Ah, ok. I recommend to parse /proc/mounts. > > I was looking for something that reminded me less of Perl and more of C > but haven't been able to find such a method. You could try to

Re: Getting mount stats for filesystems

2007-06-05 Thread Mitko Haralanov
On Tue, 05 Jun 2007 20:14:01 +0200 "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Ah, ok. I recommend to parse /proc/mounts. I was looking for something that reminded me less of Perl and more of C but haven't been able to find such a method. -- Mitko Haralanov [

Re: Getting mount stats for filesystems

2007-06-05 Thread Martin v. Löwis
> I am on machine A, which has a NFS mounted filesystem hosted on machine > B. All I need to find out is whether the NFS filesystem is mounted > using tcp or udp. Ah, ok. I recommend to parse /proc/mounts. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting mount stats for filesystems

2007-06-05 Thread Mitko Haralanov
On Tue, 05 Jun 2007 09:19:08 +0200 "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > I'm not quite sure what you want to achieve. You are on machine B, > and you want to find out whether a remote file system (on machine A) > is mounted remotely (say, from machine C)? Ok, let me try to explain: I am

Re: Getting mount stats for filesystems

2007-06-05 Thread Martin v. Löwis
Mitko Haralanov schrieb: > Hi, I am trying to find a way to figure out whether a certain remote > filesystem is mounted using tcp vs. udp in Python. I've looked at the > statvfs call and module but they don't give me anything useful (the > F_FLAGS field for both a tcp and a udp filesystem is the sa

Getting mount stats for filesystems

2007-06-04 Thread Mitko Haralanov
Hi, I am trying to find a way to figure out whether a certain remote filesystem is mounted using tcp vs. udp in Python. I've looked at the statvfs call and module but they don't give me anything useful (the F_FLAGS field for both a tcp and a udp filesystem is the same. I could, of course, get the