SlideShare a Scribd company logo
1 of 13
Download to read offline
Cpu(2110003)
Group Project
โ€œ12.File Managementโ€
Branch : Mech I-3
Prepared By: Jani Parth U.(150120119051)
Jerin Sibi.(150120119052)
Joshi Parth.(150120119053)
Guided By: Prof. Raxit Jani
INTRODUCTION
๏ต Until Now We Have Been Using The Function Such As Scanf
And Printf To Read And Write Data. These Are Console
Oriented I/O Functions, Which Always Use The Terminal As
The Target.
๏ต The Console Oriented I/O Pose Two Major Problem:
1. It Becomes Complex And Time Consuming To Handle Large
Volume Of Data Through Terminal.
2. The Entire Data Is Lost When Either The Program Is
Terminated.
๏ตA File Is A Place On The Disk Where A Group
Of Related Data Is Stored. Like Other
Language C Supports A Number Of Function
That Has The Ability To Perform Basic File
Operation, Which Include:
1. Naming A File
2. Opening A File
3. Reading Data
4. Writing Data
5. Closing A File
FUNCTION NAME OPERATION
๏ƒ˜ fopen() ๏ƒผ Creates a new file for use.
๏ƒ˜ fclose() ๏ƒผ Close a file which is open for use.
๏ƒ˜ getc() ๏ƒผ Reads a character from file.
๏ƒ˜ putc() ๏ƒผ Writes a character to a file.
๏ƒ˜ fprint() ๏ƒผ Writes a set of data values to the file.
๏ƒ˜ fscanf() ๏ƒผ Reads a set of data value from a file.
๏ƒ˜ getw() ๏ƒผ Read an integer from the file.
HIGH LEVEL I/O
FUNCTION
DEFINING AND OPENING A FILE
๏ƒ˜If we want to store data in a file in the secondary memory,
we must specify certain things about the file. They include:
1) FILENAME
2) DATA STRUCTURE
3) PURPOSE
๏ตDATA STRUCTURE OF A FILE IS DEFINED AS FILE. FOLLOWING is
the general format for declaring and opening a file.
๏ต FILE *fp;
๏ต fp = fopen(โ€œfilenameโ€ , โ€œmodeโ€);
CLOSING A FILE
๏ตA file must be closed as soon as operation on it have
been completed. Another instance where we have to
close a file is when we want to reopen it.
๏ตThe I/O library supports a function to do this for us. It
takes the following forms:
fclose(file_ pointer);
GETC AND PUTC FUNCTION
๏ต The simplest file I/O functions are getc and putc. These are
the getchar and putchar functions and handle one character
at a time. The statement:
putc(c , fp1);
๏ต Similarly, getc is used to read the character from a file that
has been opened in read mode. The statement:
c= getc(fp2) ;
GETW AND PUTW FUNCTION
๏ตThe getw and putw are integer-oriented functions.
They are similar to the getc and putc functions
and are used to read and write integer values. The
general form are:
putw(integer ,fp);
getw(fp);
THE fprintf and fscanf FUNCTION
๏ƒ˜ The function fprintf and fscanf perform I/O operation that
are identical to the familiar printf and scanf functions,
except of course that they work on files. The general form:
fprintf(fp , โ€œcontrol stringsโ€ ,list);
๏ƒ˜ The list may include constant, variable and strings. The
general format of fscanf is:
fprintf(fp , โ€œcontrol stringsโ€ ,list);
ERROR HANDLING DURING I/O OPERATOR
๏ตIt is possible an error may occur during I/O
operation on a file. They are:
1) Trying to read beyond the end- of- line mark.
2) Device overflow
3) Trying to use a file that has not been opened.
4) Trying to perform an operation on a file, when
the file is opened for another type of operation.
5) Opening a file with an invalid filename.
6) Attempting to write to a write-protected file.
RANDOM ACESS TO FILE
๏ตIt can be achieved with the help of the functions fseek,
ftell, and rewind available in the I/O library.
๏ตFtell takes a file pointer and return a number of type
long, that corresponds to the current position.
n = ftell(fp);
๏ตRewind takes a file pointer and resets the position to
the start of the file.
rewind(fp);
n = ftell(fp);
๏ตfseek function is used to move the file position to a
desired location within the file.
fseek(file_ ptr , offset, position);
COMMAND LINE ARGUMENT
๏ต Itโ€™s a parameter supplied to a program when the program is
invoked. For example , if we want to copy the contents of a file
X_FILE to another named Y_FILE, then:
C > PROGRAM X_ FILE Y_ FILE
๏ต Where PROGRAM is the filename where the executable code of
the program is stored.
File Management

More Related Content

What's hot (20)

File management in C++
File management in C++File management in C++
File management in C++
ย 
File handling in c
File handling in cFile handling in c
File handling in c
ย 
File in c
File in cFile in c
File in c
ย 
File handling in C by Faixan
File handling in C by FaixanFile handling in C by Faixan
File handling in C by Faixan
ย 
File Handling in C
File Handling in C File Handling in C
File Handling in C
ย 
File in C Programming
File in C ProgrammingFile in C Programming
File in C Programming
ย 
File handling in C
File handling in CFile handling in C
File handling in C
ย 
Lecture 20 - File Handling
Lecture 20 - File HandlingLecture 20 - File Handling
Lecture 20 - File Handling
ย 
File operations in c
File operations in cFile operations in c
File operations in c
ย 
Mesics lecture files in 'c'
Mesics lecture   files in 'c'Mesics lecture   files in 'c'
Mesics lecture files in 'c'
ย 
FILES IN C
FILES IN CFILES IN C
FILES IN C
ย 
File handling in c
File handling in cFile handling in c
File handling in c
ย 
File handling in c
File handling in c File handling in c
File handling in c
ย 
1file handling
1file handling1file handling
1file handling
ย 
C files
C filesC files
C files
ย 
File handling-c programming language
File handling-c programming languageFile handling-c programming language
File handling-c programming language
ย 
File handling-c
File handling-cFile handling-c
File handling-c
ย 
File handling
File handlingFile handling
File handling
ย 
file
filefile
file
ย 
6. chapter v
6. chapter v6. chapter v
6. chapter v
ย 

Similar to File Management

EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdfEASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdfsudhakargeruganti
ย 
File management
File managementFile management
File managementsumathiv9
ย 
C UNIT-5 PREPARED BY M V BRAHMANANDA REDDY
C UNIT-5 PREPARED BY M V BRAHMANANDA REDDYC UNIT-5 PREPARED BY M V BRAHMANANDA REDDY
C UNIT-5 PREPARED BY M V BRAHMANANDA REDDYRajeshkumar Reddy
ย 
INput output stream in ccP Full Detail.pptx
INput output stream in ccP Full Detail.pptxINput output stream in ccP Full Detail.pptx
INput output stream in ccP Full Detail.pptxAssadLeo1
ย 
Unit-VI.pptx
Unit-VI.pptxUnit-VI.pptx
Unit-VI.pptxMehul Desai
ย 
File handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxFile handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxarmaansohail9356
ย 
Topic - File operation.pptx
Topic - File operation.pptxTopic - File operation.pptx
Topic - File operation.pptxAdnan al-emran
ย 
C Programming Unit-5
C Programming Unit-5C Programming Unit-5
C Programming Unit-5Vikram Nandini
ย 
Unit5
Unit5Unit5
Unit5mrecedu
ย 
Files in C
Files in CFiles in C
Files in CPrabu U
ย 
18CS56-UP-Module 3.pptx
18CS56-UP-Module 3.pptx18CS56-UP-Module 3.pptx
18CS56-UP-Module 3.pptxChenamPawan
ย 
VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5YOGESH SINGH
ย 

Similar to File Management (20)

File management
File managementFile management
File management
ย 
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdfEASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
ย 
File Handling
File HandlingFile Handling
File Handling
ย 
File Handling
File HandlingFile Handling
File Handling
ย 
File management
File managementFile management
File management
ย 
C UNIT-5 PREPARED BY M V BRAHMANANDA REDDY
C UNIT-5 PREPARED BY M V BRAHMANANDA REDDYC UNIT-5 PREPARED BY M V BRAHMANANDA REDDY
C UNIT-5 PREPARED BY M V BRAHMANANDA REDDY
ย 
INput output stream in ccP Full Detail.pptx
INput output stream in ccP Full Detail.pptxINput output stream in ccP Full Detail.pptx
INput output stream in ccP Full Detail.pptx
ย 
Unit-VI.pptx
Unit-VI.pptxUnit-VI.pptx
Unit-VI.pptx
ย 
File handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxFile handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptx
ย 
Topic - File operation.pptx
Topic - File operation.pptxTopic - File operation.pptx
Topic - File operation.pptx
ย 
C Programming Unit-5
C Programming Unit-5C Programming Unit-5
C Programming Unit-5
ย 
Unit5
Unit5Unit5
Unit5
ย 
File in C language
File in C languageFile in C language
File in C language
ย 
Handout#01
Handout#01Handout#01
Handout#01
ย 
Unit 8
Unit 8Unit 8
Unit 8
ย 
Files in C
Files in CFiles in C
Files in C
ย 
18CS56-UP-Module 3.pptx
18CS56-UP-Module 3.pptx18CS56-UP-Module 3.pptx
18CS56-UP-Module 3.pptx
ย 
VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5
ย 
Programming in C
Programming in CProgramming in C
Programming in C
ย 
file_c.pdf
file_c.pdffile_c.pdf
file_c.pdf
ย 

More from jani parth

kinematics of 8-axis robot for material handling applications
kinematics of 8-axis robot for material handling applicationskinematics of 8-axis robot for material handling applications
kinematics of 8-axis robot for material handling applicationsjani parth
ย 
hydraulic symbols
hydraulic symbolshydraulic symbols
hydraulic symbolsjani parth
ย 
Terminology Of Spur Gear
Terminology Of Spur GearTerminology Of Spur Gear
Terminology Of Spur Gearjani parth
ย 
CNC Part programming
CNC Part programmingCNC Part programming
CNC Part programmingjani parth
ย 
Ultrasonic machining
Ultrasonic machiningUltrasonic machining
Ultrasonic machiningjani parth
ย 
Vapor-compression refrigeration โ€“ Effect of parameter
Vapor-compression refrigeration โ€“ Effect of parameterVapor-compression refrigeration โ€“ Effect of parameter
Vapor-compression refrigeration โ€“ Effect of parameterjani parth
ย 
Job evolution
Job evolutionJob evolution
Job evolutionjani parth
ย 
Fillet feature in solid works
Fillet feature in solid worksFillet feature in solid works
Fillet feature in solid worksjani parth
ย 
IC Engine emission
IC Engine emissionIC Engine emission
IC Engine emissionjani parth
ย 
Rotating unbalance system
Rotating unbalance systemRotating unbalance system
Rotating unbalance systemjani parth
ย 
Effectiveness and number of transfer units for Parallel flow
Effectiveness and number of transfer  units for Parallel flowEffectiveness and number of transfer  units for Parallel flow
Effectiveness and number of transfer units for Parallel flowjani parth
ย 
Signal flow graph
Signal flow graphSignal flow graph
Signal flow graphjani parth
ย 
hydraulic jack
hydraulic jackhydraulic jack
hydraulic jackjani parth
ย 
Band brake or band and block brake
Band brake or band and block brakeBand brake or band and block brake
Band brake or band and block brakejani parth
ย 
Casting Defects and Manufacturing Processes
Casting Defects and Manufacturing ProcessesCasting Defects and Manufacturing Processes
Casting Defects and Manufacturing Processesjani parth
ย 
Welded Joint (Theory)
Welded Joint (Theory)Welded Joint (Theory)
Welded Joint (Theory)jani parth
ย 
Reynolds Number And Experiment
Reynolds Number And ExperimentReynolds Number And Experiment
Reynolds Number And Experimentjani parth
ย 
Convergence Of Power Series , Taylor And Laurent Theorems (Without Proof)
Convergence Of Power Series , Taylor And Laurent Theorems (Without Proof)Convergence Of Power Series , Taylor And Laurent Theorems (Without Proof)
Convergence Of Power Series , Taylor And Laurent Theorems (Without Proof) jani parth
ย 
Optical Flat And Optical Square
Optical Flat And Optical SquareOptical Flat And Optical Square
Optical Flat And Optical Squarejani parth
ย 
Relative velocities
Relative velocitiesRelative velocities
Relative velocitiesjani parth
ย 

More from jani parth (20)

kinematics of 8-axis robot for material handling applications
kinematics of 8-axis robot for material handling applicationskinematics of 8-axis robot for material handling applications
kinematics of 8-axis robot for material handling applications
ย 
hydraulic symbols
hydraulic symbolshydraulic symbols
hydraulic symbols
ย 
Terminology Of Spur Gear
Terminology Of Spur GearTerminology Of Spur Gear
Terminology Of Spur Gear
ย 
CNC Part programming
CNC Part programmingCNC Part programming
CNC Part programming
ย 
Ultrasonic machining
Ultrasonic machiningUltrasonic machining
Ultrasonic machining
ย 
Vapor-compression refrigeration โ€“ Effect of parameter
Vapor-compression refrigeration โ€“ Effect of parameterVapor-compression refrigeration โ€“ Effect of parameter
Vapor-compression refrigeration โ€“ Effect of parameter
ย 
Job evolution
Job evolutionJob evolution
Job evolution
ย 
Fillet feature in solid works
Fillet feature in solid worksFillet feature in solid works
Fillet feature in solid works
ย 
IC Engine emission
IC Engine emissionIC Engine emission
IC Engine emission
ย 
Rotating unbalance system
Rotating unbalance systemRotating unbalance system
Rotating unbalance system
ย 
Effectiveness and number of transfer units for Parallel flow
Effectiveness and number of transfer  units for Parallel flowEffectiveness and number of transfer  units for Parallel flow
Effectiveness and number of transfer units for Parallel flow
ย 
Signal flow graph
Signal flow graphSignal flow graph
Signal flow graph
ย 
hydraulic jack
hydraulic jackhydraulic jack
hydraulic jack
ย 
Band brake or band and block brake
Band brake or band and block brakeBand brake or band and block brake
Band brake or band and block brake
ย 
Casting Defects and Manufacturing Processes
Casting Defects and Manufacturing ProcessesCasting Defects and Manufacturing Processes
Casting Defects and Manufacturing Processes
ย 
Welded Joint (Theory)
Welded Joint (Theory)Welded Joint (Theory)
Welded Joint (Theory)
ย 
Reynolds Number And Experiment
Reynolds Number And ExperimentReynolds Number And Experiment
Reynolds Number And Experiment
ย 
Convergence Of Power Series , Taylor And Laurent Theorems (Without Proof)
Convergence Of Power Series , Taylor And Laurent Theorems (Without Proof)Convergence Of Power Series , Taylor And Laurent Theorems (Without Proof)
Convergence Of Power Series , Taylor And Laurent Theorems (Without Proof)
ย 
Optical Flat And Optical Square
Optical Flat And Optical SquareOptical Flat And Optical Square
Optical Flat And Optical Square
ย 
Relative velocities
Relative velocitiesRelative velocities
Relative velocities
ย 

Recently uploaded

Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubaikojalkojal131
ย 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
ย 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
ย 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...SUHANI PANDEY
ย 
best call girls in Hyderabad Finest Escorts Service ๐Ÿ“ž 9352988975 ๐Ÿ“ž Available ...
best call girls in Hyderabad Finest Escorts Service ๐Ÿ“ž 9352988975 ๐Ÿ“ž Available ...best call girls in Hyderabad Finest Escorts Service ๐Ÿ“ž 9352988975 ๐Ÿ“ž Available ...
best call girls in Hyderabad Finest Escorts Service ๐Ÿ“ž 9352988975 ๐Ÿ“ž Available ...kajalverma014
ย 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfJOHNBEBONYAP1
ย 
WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)
WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)
WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
ย 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
ย 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...SUHANI PANDEY
ย 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
ย 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...SUHANI PANDEY
ย 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
ย 
All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445
All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445
All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445ruhi
ย 
๐Ÿ“ฑDehradun Call Girls Service ๐Ÿ“ฑโ˜Ž๏ธ +91'905,3900,678 โ˜Ž๏ธ๐Ÿ“ฑ Call Girls In Dehradun ๐Ÿ“ฑ
๐Ÿ“ฑDehradun Call Girls Service ๐Ÿ“ฑโ˜Ž๏ธ +91'905,3900,678 โ˜Ž๏ธ๐Ÿ“ฑ Call Girls In Dehradun ๐Ÿ“ฑ๐Ÿ“ฑDehradun Call Girls Service ๐Ÿ“ฑโ˜Ž๏ธ +91'905,3900,678 โ˜Ž๏ธ๐Ÿ“ฑ Call Girls In Dehradun ๐Ÿ“ฑ
๐Ÿ“ฑDehradun Call Girls Service ๐Ÿ“ฑโ˜Ž๏ธ +91'905,3900,678 โ˜Ž๏ธ๐Ÿ“ฑ Call Girls In Dehradun ๐Ÿ“ฑ@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
ย 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
ย 

Recently uploaded (20)

Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
ย 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
ย 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
ย 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
ย 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
ย 
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐ŸฅตLow Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
ย 
best call girls in Hyderabad Finest Escorts Service ๐Ÿ“ž 9352988975 ๐Ÿ“ž Available ...
best call girls in Hyderabad Finest Escorts Service ๐Ÿ“ž 9352988975 ๐Ÿ“ž Available ...best call girls in Hyderabad Finest Escorts Service ๐Ÿ“ž 9352988975 ๐Ÿ“ž Available ...
best call girls in Hyderabad Finest Escorts Service ๐Ÿ“ž 9352988975 ๐Ÿ“ž Available ...
ย 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
ย 
WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)
WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)
WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)
ย 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
ย 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
ย 
Thalassery Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call G...
ย 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
ย 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
ย 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
ย 
All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445
All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445
All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445
ย 
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
ย 
๐Ÿ“ฑDehradun Call Girls Service ๐Ÿ“ฑโ˜Ž๏ธ +91'905,3900,678 โ˜Ž๏ธ๐Ÿ“ฑ Call Girls In Dehradun ๐Ÿ“ฑ
๐Ÿ“ฑDehradun Call Girls Service ๐Ÿ“ฑโ˜Ž๏ธ +91'905,3900,678 โ˜Ž๏ธ๐Ÿ“ฑ Call Girls In Dehradun ๐Ÿ“ฑ๐Ÿ“ฑDehradun Call Girls Service ๐Ÿ“ฑโ˜Ž๏ธ +91'905,3900,678 โ˜Ž๏ธ๐Ÿ“ฑ Call Girls In Dehradun ๐Ÿ“ฑ
๐Ÿ“ฑDehradun Call Girls Service ๐Ÿ“ฑโ˜Ž๏ธ +91'905,3900,678 โ˜Ž๏ธ๐Ÿ“ฑ Call Girls In Dehradun ๐Ÿ“ฑ
ย 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
ย 

File Management

  • 1. Cpu(2110003) Group Project โ€œ12.File Managementโ€ Branch : Mech I-3 Prepared By: Jani Parth U.(150120119051) Jerin Sibi.(150120119052) Joshi Parth.(150120119053) Guided By: Prof. Raxit Jani
  • 2. INTRODUCTION ๏ต Until Now We Have Been Using The Function Such As Scanf And Printf To Read And Write Data. These Are Console Oriented I/O Functions, Which Always Use The Terminal As The Target. ๏ต The Console Oriented I/O Pose Two Major Problem: 1. It Becomes Complex And Time Consuming To Handle Large Volume Of Data Through Terminal. 2. The Entire Data Is Lost When Either The Program Is Terminated.
  • 3. ๏ตA File Is A Place On The Disk Where A Group Of Related Data Is Stored. Like Other Language C Supports A Number Of Function That Has The Ability To Perform Basic File Operation, Which Include: 1. Naming A File 2. Opening A File 3. Reading Data 4. Writing Data 5. Closing A File
  • 4. FUNCTION NAME OPERATION ๏ƒ˜ fopen() ๏ƒผ Creates a new file for use. ๏ƒ˜ fclose() ๏ƒผ Close a file which is open for use. ๏ƒ˜ getc() ๏ƒผ Reads a character from file. ๏ƒ˜ putc() ๏ƒผ Writes a character to a file. ๏ƒ˜ fprint() ๏ƒผ Writes a set of data values to the file. ๏ƒ˜ fscanf() ๏ƒผ Reads a set of data value from a file. ๏ƒ˜ getw() ๏ƒผ Read an integer from the file. HIGH LEVEL I/O FUNCTION
  • 5. DEFINING AND OPENING A FILE ๏ƒ˜If we want to store data in a file in the secondary memory, we must specify certain things about the file. They include: 1) FILENAME 2) DATA STRUCTURE 3) PURPOSE ๏ตDATA STRUCTURE OF A FILE IS DEFINED AS FILE. FOLLOWING is the general format for declaring and opening a file. ๏ต FILE *fp; ๏ต fp = fopen(โ€œfilenameโ€ , โ€œmodeโ€);
  • 6. CLOSING A FILE ๏ตA file must be closed as soon as operation on it have been completed. Another instance where we have to close a file is when we want to reopen it. ๏ตThe I/O library supports a function to do this for us. It takes the following forms: fclose(file_ pointer);
  • 7. GETC AND PUTC FUNCTION ๏ต The simplest file I/O functions are getc and putc. These are the getchar and putchar functions and handle one character at a time. The statement: putc(c , fp1); ๏ต Similarly, getc is used to read the character from a file that has been opened in read mode. The statement: c= getc(fp2) ;
  • 8. GETW AND PUTW FUNCTION ๏ตThe getw and putw are integer-oriented functions. They are similar to the getc and putc functions and are used to read and write integer values. The general form are: putw(integer ,fp); getw(fp);
  • 9. THE fprintf and fscanf FUNCTION ๏ƒ˜ The function fprintf and fscanf perform I/O operation that are identical to the familiar printf and scanf functions, except of course that they work on files. The general form: fprintf(fp , โ€œcontrol stringsโ€ ,list); ๏ƒ˜ The list may include constant, variable and strings. The general format of fscanf is: fprintf(fp , โ€œcontrol stringsโ€ ,list);
  • 10. ERROR HANDLING DURING I/O OPERATOR ๏ตIt is possible an error may occur during I/O operation on a file. They are: 1) Trying to read beyond the end- of- line mark. 2) Device overflow 3) Trying to use a file that has not been opened. 4) Trying to perform an operation on a file, when the file is opened for another type of operation. 5) Opening a file with an invalid filename. 6) Attempting to write to a write-protected file.
  • 11. RANDOM ACESS TO FILE ๏ตIt can be achieved with the help of the functions fseek, ftell, and rewind available in the I/O library. ๏ตFtell takes a file pointer and return a number of type long, that corresponds to the current position. n = ftell(fp); ๏ตRewind takes a file pointer and resets the position to the start of the file. rewind(fp); n = ftell(fp); ๏ตfseek function is used to move the file position to a desired location within the file. fseek(file_ ptr , offset, position);
  • 12. COMMAND LINE ARGUMENT ๏ต Itโ€™s a parameter supplied to a program when the program is invoked. For example , if we want to copy the contents of a file X_FILE to another named Y_FILE, then: C > PROGRAM X_ FILE Y_ FILE ๏ต Where PROGRAM is the filename where the executable code of the program is stored.