Get list of drives? And.....
Archives Forums/MacOS X Discussion/Get list of drives? And.....
| ||
Ok, I'm totally lost on this one :-( How would I go about getting a list of the drives through BlitzMax? And.. How can I determine which of those drives currently has the active directory? I've posted this in both the OS X section and Linux Section because the program I am working on is for both of these. Thanks for any help, -Garrett |
| ||
In Mac OS X and Linux everything is file based. So you just have to find the directory, where all drives are stored. There are no drive letters like A: B: C: D: ... On my Mac for example the drives are in "/Volumes". Where / is the root. Just use Max' file commands to get the files in "/Volumes". Open a console and goto root level. The type "ls Volumes" to list up all volumes. I think this does not work with a pre Mac OS X, since pre Mac OS X does not use a Linux kernel. |
| ||
Thanks René. I'm using the 'df' command on OS X to do the job. The problem with using the volumes directory is that it also reflects an instance of the root drive also, which of course, there's no way to tell which drive is the root in the list of available drives in the volumes directory. So using df (or mount) gets the info needed to diferentiate the root from all the other drives. Thanks, -Garrett |
| ||
René, there never has been a Linux kernel in Mac OS X... It is a Mach kernel with a FreeBSD user land, derived from NeXTstep whose development already began in the second half of the eighties - long before Linus Torvalds even thought about writing a POSIX kernel. And NeXTstep itself goes back to 4.3 BSD, a "real" UNIX. |
| ||
never has been a Linux kernel in Mac OS X well... as near to having one as makes little difference. A user isn't likely to notice much difference when using one or the other from the command-line. Only when you start looking at structs for things like volume information do things differ, but then only slightly. Once you know how to do something on one, it's not a great leap to do it on the other - 99% of the time ;-) Pre OS X was GUI only and therefore much less fun, I think :-) |
| ||
Working on the command line is a dying art these days. Most users don't even know that underneath that pretty gui desktop is a command line shell that's just itching to be abused by someone willing to take it to it's limits. Once you know how to do something on one, it's not a great leap to do it on the other - 99% of the time ;-) I must be in that 1% there. I had a heck of a time trying to learn how to use the command line under Linux/Unix, and that's even after years upon years of abusing Dos. Of course, it's been a few years now and now it's like second nature to me. It's probably easier for a Linux/Unix users to come over to the Dos command line and not take long to get familiar with it, rather than a Dos user coming over to the Linux/Unix command line. |
| ||
For that fact, ask any of the youngsters these days if they even know what telnet is, or what a BBS is, or ArpaNet.. Hehehehehehee I wonder if they've heard of things like CP/M? |