By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,543 Members | 2,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,543 IT Pros & Developers. It's quick & easy.

get a list of mounted filesystems under MacOSX

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
maybe you can catch the result of /bin/df and parse it.

Aug 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.