RE: mc devices backwards...
- From: Lars Torben Wilson <torben pinc com>
- To: "Fox, Kevin M" <KMFox mail bhi-erc com>
- Cc: "gnome-list gnome org" <gnome-list gnome org>
- Subject: RE: mc devices backwards...
- Date: Mon, 12 Apr 1999 17:28:55 -0700 (PDT)
Fox, Kevin M writes:
> I have talked to atleast one other person, which makes me believe that it
> allways happens this way... maby it would be better just to reverse order
> it... then it will come out correct...
>
> or an option to reverse order :)
At least on Linux, it appears to return the filesystems in whichever
order they appear in /etc/fstab. I tested this out just now with a
little program (see the end of this letter).
Sample output (after messing with the fstab order a bit):
%ali ./mntent_test
FS name: /dev/hdb1
FS name: //sirius/outlander
FS name: /dev/hda5
FS name: /dev/hda1
FS name: /dev/cdrom
FS name: /dev/fd0
FS name: /dev/hda2
FS name: /dev/hda3
FS name: /dev/hdb2
FS name: /dev/hdb5
FS name: /dev/hdc1
FS name: none
FS name: /dev/hdb6
%ali
Torben
-------------------------------------------------------
/* Standard disclaimer: if you use this,
* anything it does is your own fault. :) */
/* mntent_list.c
* Simple example of listing filesystems.
*/
#include <stdio.h>
#include <mntent.h>
int
main()
{
struct mntent *me;
FILE *fp;
if ( (fp = setmntent( "/etc/fstab", "r" ) ) == NULL )
{
printf( "Couldn't open fstab.\n" );
return 1;
}
while ( ( me = getmntent( fp ) ) )
{
printf( "FS name: %s\n", me->mnt_fsname );
}
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]