open() System Call Program in Linux

Поделиться
HTML-код
  • Опубликовано: 7 май 2020
  • In this lecture on the open system call program in Linux you will learn how to write a program to get the file descriptor of user created file using the open() system call. The open() system call returns the file descriptor of the file on success. Pn failure, it returns -1.
    Subscribe - / dextutor
    This lecture is part of the Operating System Lab playlist: • Operating System Lab
    For Program code and more details visit: dextutor.com/open-system-call/
    Reference Videos:
    1. Linux installation: • Linux Installation
    2. Practice Programs: • System call open-lseek...
    3. Viva Questions: • System calls viva ques...
    Tools Required:
    1. Linux environment
    2. Basic knowledge of C Language
    3. gcc compiler installed
    Reference Links:
    Operating System Theory PPTs Link: dextutor.com/courses/operatin...
    Operating System Programs: dextutor.com/courses/operatin...
    Other Playlists:
    OS: • Operating System
    Linux Essential: • Linux Tutorial For Beg...
    RHCSA: • RHCSA Exam Full Course
    Was this tutorial about the program on open system call helpful? If so, please share. Let me know your thoughts in the comments.
    #linux #oslab #os #systemcalls

Комментарии • 28

  • @user-zh3jx4lq1y
    @user-zh3jx4lq1y Год назад +2

    Awesome Content. Thank you :)

  • @happyindia5740
    @happyindia5740 9 месяцев назад +2

    Thank you sir and please make videos on cpu scheduling algorithms like for FCFS,SJF etc.

  • @Ki21
    @Ki21 Год назад +2

    Such grt vdos ❤

  • @harshavardhan3325
    @harshavardhan3325 3 года назад +4

    very good explanation

    • @dextutor
      @dextutor  3 года назад

      Thanks.. Share among your friends

  • @vaiebhavpatil2340
    @vaiebhavpatil2340 2 года назад +4

    solution for Q2 for exercise given on your web page?
    Q2. Write a program using open() system call to copy the contents of one file into another file.

  • @_TushaarGusain
    @_TushaarGusain 3 года назад +3

    Can we use libraries of linux like in ubuntu for windows

  • @minhhieuhuynh5174
    @minhhieuhuynh5174 2 года назад +2

    Thanks a lot for your video. Could you please explain, what does 0642 in open("target",O_CREAT|O_WRONLY,0642); means?

    • @dextutor
      @dextutor  2 года назад

      These are the permissions on the file. 6 (read and write) for user, 4(read) for group and 2(write) for others. You can give any permissions you want. For details on permissions refer ruclips.net/video/wKZH-7P7YZE/видео.html

    • @minhhieuhuynh5174
      @minhhieuhuynh5174 Год назад

      @@dextutor Thank you so much for your explanation :))

  • @rejwanarahman1886
    @rejwanarahman1886 2 года назад +2

    Plz make vedio in close system call

    • @dextutor
      @dextutor  2 года назад

      close(fd)
      where fd is the file descriptor.. The use of close system call is to close the file pointed to by the file descriptor fd

  • @Ash-ej3nx
    @Ash-ej3nx 2 года назад

    How does content of file is saved in buf if we haven't assign it

    • @dextutor
      @dextutor  2 года назад

      The file descriptor of the file is passed as first argument in the read() system call

    • @Ash-ej3nx
      @Ash-ej3nx 2 года назад

      @@dextutor so basically it points towards the file and buff is used as memory

  • @anayakhan3038
    @anayakhan3038 3 года назад +1

    if we don't have any existinh file how we create it ?

    • @dextutor
      @dextutor  3 года назад +2

      You can use the touch command or any editor. Just watch this video
      ruclips.net/video/t5CqOY7eTQI/видео.html

  • @gilbertolozano3480
    @gilbertolozano3480 10 месяцев назад

    @DexTutor Why doesn't it have subtitles in Spanish?

    • @dextutor
      @dextutor  10 месяцев назад

      No idea :-)

  • @huzaifa_a4602
    @huzaifa_a4602 Год назад

    what is the purpose of 0 in 0642?

    • @dextutor
      @dextutor  Год назад

      That bit can be used to set user-id, group-id or sticky bit

  • @uroojtariq6671
    @uroojtariq6671 Год назад

    I am facing an error undeclared o_rdonly how to fix this even i have included all the libraries