From owner-freebsd-questions Tue Dec 1 04:53:50 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA24834 for freebsd-questions-outgoing; Tue, 1 Dec 1998 04:53:50 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from post.mail.demon.net (post-12.mail.demon.net [194.217.242.41]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA24829 for ; Tue, 1 Dec 1998 04:53:48 -0800 (PST) (envelope-from marko@uk.radan.com) Received: from [158.152.75.22] (helo=uk.radan.com) by post.mail.demon.net with smtp (Exim 2.053 #1) id 0zkpJ3-00064s-00; Tue, 1 Dec 1998 12:53:32 +0000 Organisation: Radan Computational Ltd., Bath, UK. Phone: +44-1225-320320 Fax: +44-1225-320311 Received: from beavis.uk.radan.com (beavis [193.114.228.122]) by uk.radan.com (8.6.10/8.6.10) with SMTP id MAA03345; Tue, 1 Dec 1998 12:52:44 GMT Received: from uk.radan.com (gppsun4) by beavis.uk.radan.com (4.1/SMI-4.1) id AA07892; Tue, 1 Dec 98 12:52:42 GMT Message-Id: <3663E668.CCF19E43@uk.radan.com> Date: Tue, 01 Dec 1998 12:51:52 +0000 From: Mark Ovens Organization: Radan Computational Ltd X-Mailer: Mozilla 4.03 [en] (X11; I; SunOS 4.1.3_U1 sun4m) Mime-Version: 1.0 To: Chris Cc: freebsd-questions@FreeBSD.ORG Subject: Re: umask References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Chris wrote: > > hello. i was wondering if someone could please explain the working of > umask. i understand what it does and what not, just not how to work out > the octal numbers to get the desired result. > The umask value is Xor'd with the default perms of 666 for files (777 for dirs) to arrive at the perms for a file/dir created by the user. For example, if your umask is 022 then any files you create will have 644 perms (rw-r--r--). If you write it out in binary it makes it clearer: Files (r w - r w - r w -) default 666 1 1 0 1 1 0 1 1 0 umask 022 0 0 0 0 1 0 0 1 0 Xor'd gives 1 1 0 1 0 0 1 0 0 (r w - r - - r - -) Dirs (r w x r w x r w x) default 777 1 1 1 1 1 1 1 1 1 umask 022 0 0 0 0 1 0 0 1 0 Xor'd gives 1 1 1 1 1 1 1 0 1 (r w x r - x r - x) HTH > Thanks > > chris > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- Trust the computer industry to shorten Year 2000 to Y2K. It was this thinking that caused the problem in the first place. Mark Ovens, CNC Applications Engineer, Radan Computational Ltd. Bath, Avon, England. Sheet Metal CAD/CAM Solutions mailto:marko@uk.radan.com http://www.radan.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message