Text vs
binary files
And
Sequential files
vs random files
With
modes
1. File handling
fopen() :- Create a new file or open a exiting file .
Functi
ons
fclose() :- Close a file .
fwrite() :- To write a file .
get c () :- Read a character from a file .
put c () :- Write a character to a file .
Syntax
 fp=fopen(“file name .text”, mode”);
int fclose(FILE *stream);
int getc(FILE *stream);
int putc(int character, FILE *stream);
Text and binary modes of
files
Reading from a file
Writing to a file
Appending to a file
Reading binary data from a file
Sequential and
Random files
Sequential access means that a group of element is accessed predetermined
ordered sequence .
Sequential files
Random files
Random access files will be spitted into pieces and will be stored wherever
space available .
Advantages of
sequential files
 Lower storage requirement .
 Simple file management .
 Logging and auditing .
 Data streaming .
 Limited storage environment .
 Faster data access .
Advantages of
random files
Flexible data access .
Easier data management .
Better performance .
Large databases .
Scientific data analysis .
text and binary sequential and random files with modes

text and binary sequential and random files with modes

  • 1.
    Text vs binary files And Sequentialfiles vs random files With modes
  • 2.
    1. File handling fopen():- Create a new file or open a exiting file . Functi ons fclose() :- Close a file . fwrite() :- To write a file . get c () :- Read a character from a file . put c () :- Write a character to a file .
  • 3.
    Syntax  fp=fopen(“file name.text”, mode”); int fclose(FILE *stream); int getc(FILE *stream); int putc(int character, FILE *stream);
  • 4.
    Text and binarymodes of files Reading from a file Writing to a file Appending to a file Reading binary data from a file
  • 5.
    Sequential and Random files Sequentialaccess means that a group of element is accessed predetermined ordered sequence . Sequential files Random files Random access files will be spitted into pieces and will be stored wherever space available .
  • 6.
    Advantages of sequential files Lower storage requirement .  Simple file management .  Logging and auditing .  Data streaming .  Limited storage environment .  Faster data access .
  • 7.
    Advantages of random files Flexibledata access . Easier data management . Better performance . Large databases . Scientific data analysis .