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: create new file from bash: with DACL, owner, & group as windows would


On Wed 5/18/05 16:18 CDT Tom Rodman wrote:
> > $ CYGWIN=nontsec touch foo
> 
> Thanks Brian, that should do it.

Here's a function I plan to use:

wtouch()
{
  local file=$1
  CYGWIN=nontsec touch "$file"
  setacl -on "$(cygpath -aw "$file")" -ot file \
    -actn setowner -ownr "n:Administrators;s:n" \
    -actn setgroup -grp  "n:None;s:n" \
    -silent || echo $FUNCNAME:setacl failed
    # see http://setacl.sourceforge.net/html/doc-reference.html 
}

I'm usually an admin, hence the setacl.  The advantage of
setacl over chown is that the setacl above has no impact on the
DACL.

Example:
  $ wtouch foo
  $ cat /tmp/mycontents > foo  # leaves owner,group and DACL untouched [I think]

--
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]