open( ) system call

commandline session

$ 4.2.36 50 548---> cat test-open.c
#include 
#include 
#include 

main()
{
int fd;
fd = open( "text" , O_CREAT);
}
$ 4.2.36 51 549---> gcc test-open.c
$ 4.2.36 52 550---> ./a.out
$ 4.2.36 53 551---> ls
a.out  test-open.c  text
$ 4.2.36 54 552---> cat text
cat: text: Permission denied
$ 4.2.36 55 553---> ls -l  text
---S--s--T 1 jeffrin jeffrin 0 Sep  9 20:56 text
$ 4.2.36 56 554---> sudo cat text
[sudo] password for jeffrin:
$ 4.2.36 57 555---> umask -S
u=rwx,g=rx,o=rx
$ 4.2.36 58 556---> vi test-open.c
$ 4.2.36 59 557---> gcc test-open.c
$ 4.2.36 60 558---> ./a.out
$ 4.2.36 61 559---> ls -l  text
---S--s--T 1 jeffrin jeffrin 0 Sep  9 20:56 text
$ 4.2.36 62 560--->

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s