In computer system what will happen if you create a file with the same name which already exists?
Answers
Answered by
2
In most programming cases, it is overwritten. Most software will include some sort of prompt when you are overwriting an existing file, and some will append a numeral to the filename to avoid file collisions. But in code, it does whatever you told it to do. So if you say, save to xyz.txt, and xyz.txt already exists, the original file is gone.
To avoid such a problem, check to see if the file exists before saving a new copy. Then you ca take one of the above actions (prompt the user, or append an iterator/numeral). If appropriate, your language of choice probably also has a way to append to an existing file. For example, if you’re logging for debugging or audit purposes, you don’t want to blow up the existing file, you want to add to it.
HOPE YOU LIKE THE ANSWER
PLZ MARK ME BRAINLIEST
To avoid such a problem, check to see if the file exists before saving a new copy. Then you ca take one of the above actions (prompt the user, or append an iterator/numeral). If appropriate, your language of choice probably also has a way to append to an existing file. For example, if you’re logging for debugging or audit purposes, you don’t want to blow up the existing file, you want to add to it.
HOPE YOU LIKE THE ANSWER
PLZ MARK ME BRAINLIEST
Japneet27:
I require only 2 BRAINLIEST to upgrade my rank
Answered by
0
it responds that file already exists.hope it helps.pls don't mind pressing a small button to follow
Similar questions