This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getmntent extended


On Tue, 2 Nov 2004, Reini Urban wrote:

> Igor Pechtchanski schrieb:
> > On Sun, 31 Oct 2004, Reini Urban wrote:
> > > Is it possible to let getmntent() i.e. fillout_mntent()
> > > return something more appropriate?
> > > or would this break existing apps?
> > >
> > > getmntent() currently returns either "system" or "user" (user or system
> > > mounts), which are kinda strange fstype names.
> > >
> > > I expected them to return something like "msdos", "pc", "fat", "vfat" or
> > > "ntfs". Those are currently supported by current findutils on mounted dos
> > > drives in unix systems.
> > > Maybe also an indiciator for subst'ed drives: "subst" and remote shares,
> > > but this has no equivalent at unix.
> > >
> > > Apps using this are to my knowledge only
> > > df -t <type>, and find -fstype <type>
> > > I could change that in coreutils and findutils, as findutils also
> > > adds some logic for certain esoteric platforms, but I thought asking
> > > for it upstream costs nothing.
> > > [snip]
> >
> > Yes, it's possible: <http://cygwin.com/ml/cygwin/2002-09/msg01035.html>.
> > But, <http://cygwin.com/acronyms/#SHTDI>...
>
> Ok, we agreed now that it's a good thing.
> Have you already started?
>
> http://cygwin.com/ml/cygwin/2002-09/msg01044.html
> >"If people agree it's a good idea, I'll start on the implementation.
> >	Igor"

No, I haven't started, unfortunately.  Feel free to take over.

> Idea:
> use mnt->mnt_type from GetVolumeInformation().lpFileSystemNameBuffer
> move user/system from mnt->mnt_type to mnt->mnt_opts
> add more mnt->mnt_opts
> fix all the places like m->issys
> add extended output (all opts) to cygcheck.cc, as in mount
>
> If we agree mnt->mnt_opts will have then the following optional
> comma-seperated strings: (current state)
>   system/user, textmode/binmode, cygexec/exec/noexec,
>   managed, noumount

It might be better to make those flags instead...

> other useful options to consider, gathered by GetVolumeInformation():
>   compressed, case-preservant, case-sensitive, encrypted, read-only

Again, flags.

> other useful options to consider, gathered by GetDriveType():
>   no-root-dir, emovable, remote, cdrom, ramdisk

This should be fstype.

> additional checks to be done for SUBST:
>   subst

So is this.

IIRC, what started this was a problem with 'find -xdev' which used a
(wrong) heuristic for determining remote drives (colon in the path) that
worked in reverse on Cygwin.  Is 'find' still part of findutils, or has it
moved to coreutils?  In any case, does the new version still have this
bug?  If so, it should be fixed to use the fstype field of the mntent...
Or is there a local/remote flag?

> we should leave out default options, and only store them if they are
> non-default, ok?

I don't see why, frankly.  If you use the flags approach, just make the
default values be 0's... :-D

> so we should assume no-case-preservant on FAT and case-preservant on NTFS.
> no-case-sensitive on all windows drive types.

I'd add a bit of logic for NTFS to set the case-preservant flag.  The
case-sensitive vs. case-insensitive is reasonably meaningless on Cygwin,
since it's controlled by the "check_case" option in $CYGWIN (which
hopefully will not be removed anytime soon [@Corinna])...

> maybe sooner or later someone will come up with mounting external drive
> types (iso9660, ext2fs) also. (Daemon-Tools, e2fsimage, ...)

It's already possible, using non-Cygwin tools, but that doesn't mean
people won't do this.  Other possible useful types to distinguish are
Unix->Samba drives and Clearcase drives...

> BTW: The research at the mail above forgot about getmntent() and
> fillout_mntent() in path.cc. fillout_mntent() is the main worker.
>
> If not I'll start also, 'cause I want that feature in coreutils and
> findutils.

Yep, please do start on it.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]