[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 110: Undefined array key "cached"
[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 111: Undefined array key "normal"
[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 112: Undefined array key "total"
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3391: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3393: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3394: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3395: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
Cabrillo College Linux Classes • View topic - umask 777

umask 777

Introduction to UNIX/Linux

umask 777

Postby Wesley Jessup on Wed Oct 22, 2008 4:30 pm

/home/cis90/jessuwes $ umask 777
/home/cis90/jessuwes $ touch newer; mkdir newer
mkdir: cannot create directory `newer': File exists

But,

/home/cis90/jessuwes $ ls -F
bigfile dead.letter in2008 misc/ oct-08-2006/ uhistory_rsimms
bin/ docs/ lab02 new old userlist
cis90_lab4 edits/ letter newdir/ olddir/
class/ etc/ log newer poems/
classlist Hidden/ mbox newfile uhistory

I see the file newer, but no "/" indicating a directory called newer.

And,

/home/cis90/jessuwes $ ls -ld newer
---------- 1 jessuwes cis90 0 Oct 22 16:00 newer

I see no "d" bit set for newer.

Shouldn't the error have been on the creation of the file, and the directory created AND shown to the User as a directory?

Thanks,
Wes
Wesley Jessup
 
Posts: 40
Joined: Wed Sep 03, 2008 7:29 pm

Re: umask 777

Postby Rich Simms on Thu Oct 23, 2008 7:50 am

Hi Wes,

The ; allows you to place two commands on one line. They are executed the same way as if you had put them on two lines. Your first command creates a new file named newer. The second command fails as the file newer already exists.

mkdir makes new directories and fails if you give it the name of an existing file.

Here is same example without the ; with the same result:

[code]/home/cis90/simmsben $ umask 777
/home/cis90/simmsben $ touch newest
/home/cis90/simmsben $ mkdir newest
mkdir: cannot create directory `newest': File exists
/home/cis90/simmsben $ ls -l newest
---------- 1 simmsben cis90 0 Oct 23 07:34 newest
/home/cis90/simmsben $
[/code]

- Rich
User avatar
Rich Simms
Site Admin
 
Posts: 640
Joined: Thu May 15, 2008 2:44 pm

Re: umask 777

Postby Michael Wicherski on Thu Oct 23, 2008 11:52 pm

remember the unix filesystem doesn't distinguish between filenames and "foldernames" because folders (directories) are just files
Michael Wicherski
 
Posts: 140
Joined: Mon Sep 01, 2008 5:23 am

Re: umask 777

Postby Wesley Jessup on Wed Oct 29, 2008 11:08 am

Thanks for the reply.

I see my problem now had been not following instructions. It should have been:

umask 777
touch newer; mkdir newerdir

-Wes
Wesley Jessup
 
Posts: 40
Joined: Wed Sep 03, 2008 7:29 pm

Re: umask 777

Postby Michael Wicherski on Wed Oct 29, 2008 11:49 am

(technically you never had to make a "newerdir" ; but if you did then it is just more practice and example of what happens with umask 777 ~.^ )
Michael Wicherski
 
Posts: 140
Joined: Mon Sep 01, 2008 5:23 am


Return to CIS 90 - Fall 2008

Who is online

Users browsing this forum: No registered users and 0 guests

cron