473,387 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

get a list of mounted filesystems under MacOSX

Hi all,
I am trying to port my (linux) program to MacOSX, and I need to get a
list of mounted filesystems. Under linux, it was easy, I was parsing
/etc/mtab (or /proc/mounts), this works also on some other unices.
But I have no idea how to do it on MacOSX, apart from calling "mount" as
an external program and parsing the output - but I prefer "cleaner"
solutions. Is there one?

And when we are at this, how to find out a list of mounted filesystems
under MS Windows? (yes, I know, there is a difference between cygwin
python and native port, and the term "mounted" is not used in MS Windows
world much)

--
-----------------------------------------------------------
| Radovan GarabĂ*k http://kassiopeia.juls.savba.sk/~garabik/ |
| __..--^^^--..__ garabik @ kassiopeia.juls.savba.sk |
-----------------------------------------------------------
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!
Aug 15 '05 #1
3 6195
ga******************@kassiopeia.juls.savba.sk wrote:
Hi all,
I am trying to port my (linux) program to MacOSX, and I need to get a
list of mounted filesystems. Under linux, it was easy, I was parsing
/etc/mtab (or /proc/mounts), this works also on some other unices.
But I have no idea how to do it on MacOSX, apart from calling "mount" as
an external program and parsing the output - but I prefer "cleaner"
solutions. Is there one?


why not looking at the content of the /Volumes folder?

my 2 cents

--
rafi

"Imagination is more important than knowledge."
(Albert Einstein)
Aug 15 '05 #2
rafi <ra**@free.fr> wrote:
ga******************@kassiopeia.juls.savba.sk wrote:
Hi all,
I am trying to port my (linux) program to MacOSX, and I need to get a
list of mounted filesystems. Under linux, it was easy, I was parsing
/etc/mtab (or /proc/mounts), this works also on some other unices.
But I have no idea how to do it on MacOSX, apart from calling "mount" as
an external program and parsing the output - but I prefer "cleaner"
solutions. Is there one?


why not looking at the content of the /Volumes folder?


because the filesystem could be mounted elsewhere (in fact, the Mac Mini
I have across the table has a big network storage nfs-mounted on /data)
--
-----------------------------------------------------------
| Radovan GarabĂ*k http://kassiopeia.juls.savba.sk/~garabik/ |
| __..--^^^--..__ garabik @ kassiopeia.juls.savba.sk |
-----------------------------------------------------------
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!
Aug 16 '05 #3
maybe you can catch the result of /bin/df and parse it.

Aug 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Terry Richards | last post by:
i have macosx 10.2.8. i am trying to install php-4.3.10. i am getting: make gcc -Iext/standard/ -I/Users/terryr/tmp/php-4.3.10/ext/standard/ -DPHP_ATOM_INC...
2
by: Joe | last post by:
Is there a way to mount a network share from within Python on MacOSX? I imagine it would be the same as for Unix, but I don't know how to do it for Unix either. I have searched python.org and...
10
by: svenn.are | last post by:
Hi, I wanted to run a program that is written in PyQt on my mac, and went over to Riverbank to get PyQ 3.13 and SIP 4.1.1 sources. I followed the installation guide except for the compiling...
1
by: Tim Daneliuk | last post by:
Is there some pure Python/portable way to get a list of all currently mounted filesystems? ---------------------------------------------------------------------------- Tim Daneliuk ...
4
by: Paul Reddin | last post by:
Hi, Please don't throw your hands up immediately and quote me "this is not supported" etc .... I have a "temporary need" to move our DEVELOPMENT databases off our SAN and onto an NFS...
43
by: michael.f.ellis | last post by:
The following script puzzles me. It creates two nested lists that compare identically. After identical element assignments, the lists are different. In one case, a single element is replaced. In...
7
by: Mitko Haralanov | last post by:
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...
4
by: gentsquash | last post by:
On some of my course pages, I quote (with attribution) small sections of Wikipedia and the like. E.g, the top of http://en.wiktionary.org/wiki/entropy has "entropia" in Greek font, ...
4
by: Tommy | last post by:
I want to make a program to minitor the usages of all of the file systems on my AIX or Linux systems. But I will not use shell commands like "df -k" for some FILE SYSTEMS maybe not mounted and "df...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.