Judul materi : Files Processing.
Definisi file adalah a collection of record.
Definisi record adalah a collection of field.
Field adalah a block of byte.
Byte is a collection of bit.
File *fp - untuk tempat menampung file yang ingin kita buka.
r : read, buka file lalu read doang. Buat ambil data dari file.
w : write, buka file lalu write doang. Buat menuliskan sesuatu ke filenya.
a : append, buka file lalu update ato ngubah data yang udah ada sebelumnya.
Beda append sama write : kalo append, ngubah data yang lama, kalo write bikin data baru terus ditambahin ke filenya.
r+ : buka file trus read sama write.
w+ : buka file, kalo file nya udh ada bakal di delete isinya, kalo gk ada bakal create baru.
a+ : buka file buat append atau read.
rb : buka file (binary) buat di read.
wb : kyk w+ tapi buat file(binary).
No comments:
Post a Comment