[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New packages and cross-config.gnu

Roland McGrath <roland@frob.com> writes:

> > I'd rather GNU be a nice system, than try and separate out naturally
> > joined functionality.  sync, on GNU, should be responsible for sync,
> > in all its various flavors.  On linux only one kind of sync is
> > possible, but that's not important to us; fileutils sync is GNU sync,
> > not just Unix sync, and we should not hesitate to have it do better
> > and more clever stuff on the Hurd.
> Actually, there is a problem with this theory in some cases, and sync is
> one.  It can make it difficult to check at the shell level for the
> availability of the functionality (without resorting to kludges like uname).

Perhaps I'm missing something, but why not have

Ordinary, asynchronous sync: sync
Syncronous sync:             sync --synchronous
Shell script, equivalent
   to the above:             sync²

The sync command would be the recommended program for doing all sorts
of syncing, while the sync² command could be used for shellscripts
that for some reason needs to check if synchronous syncing is

As far as kludges go, I guess a shell script could also do something

  if [ sync --fail -o ! sync --syncronous ] ; then
  # Synchronous sync unavailable
    sync ; sleep 17 # Whatever

assuming that a sync --fail will indeed fail if the sync command
supports options.


Reply to: