RE: mc devices backwards...



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]