Code Monkey home page Code Monkey logo

ex1's Introduction

kotek, yoavabadi
Aviv Kotek (203973490), Yoav Abadi (305613903)
EX: 1

FILES:
osm.cpp -- osm implementation
osm.h -- osm header file

-------------
Assignment 1
-------------

Analysing result of command 'strace WhatIDo 0' (with argument 0):
-------------------------------------------------------------
mkdir("Welcome", 0775)                  = 0
mkdir("Welcome/To", 0775)               = 0

This command creates Welcome directory successfully (return value = 0)
And creates Inner 'To' directory successfully.

mode 775 is giving you permission to the file.
-------------------------------------------------------------
open("Welcome/To/OS2018", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3

This command uses the open() sys-call:
it opens the file OS2018  in folder 'Welcome/To with flags of
'write' and 'create' and with O_trunc which will truncate file to 0 length.
'= 3' means the function returned FILE DESCRIPTOR is 3. In case of failure
we will have =-1, so this is not a failure.

flags -
O_WRONLY - Open for writing only.
O_CREAT - If the file exists, this flag has no effect, Otherwise, the file is created.
O_TRUNC - if the file exists and is a regular file, and the file is successfully opened by O_WRONLY,
 its length is truncated to 0 and the mode and owner are unchanged.

--------------------------------------------------------------
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0

This command uses the fstat() sys-call:
Which returns information about the 'os2018' file,
it returned 0 means the sys-call completed successfully.
--------------------------------------------------------------
write(3, "kotek\nIf you haven't read the co"..., 74) = 74

Program calls write sys-call and tries to write 74 characters to OS2018 file,
about the course guidelines, and it did succeed (we can see by the
descriptor id that has been returned != -1).
--------------------------------------------------------------
close(3)                                = 0

This system call succeed closing the file,
as return value is 0.
--------------------------------------------------------------
unlink("Welcome/To/OS2018")             = 0

This sys-call deleted the file OS2018 from the file system.
this call also succeeded.
--------------------------------------------------------------
rmdir("Welcome/To/")                    = 0
rmdir("Welcome/")                       = 0

Both sys-calls deletes given directories (Welcome and To) and succeed.
--------------------------------------------------------------
exit_group(0)                           = ?
+++ exited with 0 +++

This sys-call exit all threads in the process and terminates them.
We can see that it has succeeded.
--------------------------------------------------------------

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.