SlideShare a Scribd company logo
1 of 2
Download to read offline
Problem: How do you copy a file?
Analyze the problem and consider alternate solutions:
Objective: reproduce a file.
Elements: (output) newfile, (input) oldfile
Relations: copy,reproduce, create a copy, photocopy, ...
Algorithm:
?
1
2
3
4
5
6
7
8
9
10
11
12
determine which file to copy from
find the oldfile
if cannot find oldfile, ???? else continue
determine which file to copy to
find the newfile
if newfile exists, ????? else continue
prepare (open) oldfile
prepare (open) newfile
transfer data from oldfile to newfile
put away (close) oldfile
put away (close) newfile
display the outcome
Note that our pseudocode is generic enough to follow a manual or a computerized process.
To construct a solution in the bash environment, we need to do some preparations:
1. Create a file for each script (do not get into the habit of just adding to the same file - one
solution, one file). For each variation (version), copy the current file to a file that identifies the
version. For example:
~$ mkdir bin
~$ cd bin
~/bin$ vi copy
.
.
.
~/bin$ cp copy copy.verA
~/bin$ vi copy
.
.
.
~/bin$ cp copy copy.verB
...and so on.
2. In your ~/bin directory (as demonstrated above), create a file called "copy", enter the code as
shown below, save the file and change the permissions so that you can execute the file.
~/bin$ vi copy
~/bin$ chmod 705 copy
3. Learn more about bash shell by examining the manual page: man bash
Let's return to the problem. From modelling example solutions, a number of questions should
come to mind, such as
What is a file? regular file? directory? special file?
Where do these values come from? are they chosen arbitrarily, by the user, by another program?
Identify other relevant information.
Identify and describe uncertainties about the interpretation of the problem.
Let's examine what happens to our solution as we make different assumptions about the problem
Stop and analyze:
Explore other alternatives and related assumptions.
Explore the implications of ambiguities when analysing a problem.
Consider the impact of alternative solutions on various types of users.
Plan and document how to test potential solutions.
Recognize and control your own biases when choosing a solution.
Version A: ....the first version is incomplete, yet provides a wealth of information that we address
one step at a time. r/bin$ copy
1
2
3
4
5
6
7
8
9
10
11
12
determine which file to copy from
find the oldfile
if cannot find oldfile, ???? else continue
determine which file to copy to
find the newfile
if newfile exists, ????? else continue
prepare (open) oldfile
prepare (open) newfile
transfer data from oldfile to newfile
put away (close) oldfile
put away (close) newfile
display the outcome

More Related Content

Similar to Problem How do you copy a file Analyze the problem and con.pdf

Why You Need A Duplicate File Explorer
Why You Need A Duplicate File ExplorerWhy You Need A Duplicate File Explorer
Why You Need A Duplicate File Explorerjohnset
 
cs3157-summer06-lab1
cs3157-summer06-lab1cs3157-summer06-lab1
cs3157-summer06-lab1tutorialsruby
 
cs3157-summer06-lab1
cs3157-summer06-lab1cs3157-summer06-lab1
cs3157-summer06-lab1tutorialsruby
 
Managing files chapter 7
Managing files chapter 7 Managing files chapter 7
Managing files chapter 7 shinigami-99
 
Managing files chapter 7
Managing files chapter 7 Managing files chapter 7
Managing files chapter 7 shinigami-99
 
R&D on PVS-Studio
R&D on PVS-StudioR&D on PVS-Studio
R&D on PVS-StudioPVS-Studio
 
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docx
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docxCS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docx
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docxannettsparrow
 
File handling.pptx
File handling.pptxFile handling.pptx
File handling.pptxVishuSaini22
 
Reverse Engineering in Linux - The tools showcase
Reverse Engineering in Linux - The tools showcaseReverse Engineering in Linux - The tools showcase
Reverse Engineering in Linux - The tools showcaseLevis Nickaster
 
FTK report PART I Familiar with FTK ImagerBonus Exerc.docx
FTK report PART I Familiar with FTK ImagerBonus Exerc.docxFTK report PART I Familiar with FTK ImagerBonus Exerc.docx
FTK report PART I Familiar with FTK ImagerBonus Exerc.docxbudbarber38650
 
Lpi Part 2 Basic Administration
Lpi Part 2 Basic AdministrationLpi Part 2 Basic Administration
Lpi Part 2 Basic AdministrationYemenLinux
 
Reproducibility: 10 Simple Rules
Reproducibility: 10 Simple RulesReproducibility: 10 Simple Rules
Reproducibility: 10 Simple RulesAnnika Eriksson
 
file+not+too+large
file+not+too+largefile+not+too+large
file+not+too+largetodai951
 
1.0 QuickBooks Fundementals : Day 02 Windows :2.1 windows
1.0 QuickBooks Fundementals : Day 02 Windows :2.1 windows1.0 QuickBooks Fundementals : Day 02 Windows :2.1 windows
1.0 QuickBooks Fundementals : Day 02 Windows :2.1 windowsVeerendra Singh
 
Internal lunchtime-learning--2013 jan22--data management
Internal lunchtime-learning--2013 jan22--data managementInternal lunchtime-learning--2013 jan22--data management
Internal lunchtime-learning--2013 jan22--data managementMiles Baltrusaitis
 

Similar to Problem How do you copy a file Analyze the problem and con.pdf (20)

Why You Need A Duplicate File Explorer
Why You Need A Duplicate File ExplorerWhy You Need A Duplicate File Explorer
Why You Need A Duplicate File Explorer
 
cs3157-summer06-lab1
cs3157-summer06-lab1cs3157-summer06-lab1
cs3157-summer06-lab1
 
cs3157-summer06-lab1
cs3157-summer06-lab1cs3157-summer06-lab1
cs3157-summer06-lab1
 
NISO Webinar: Software Preservation and Use: I Saved the Files But Can I Run ...
NISO Webinar: Software Preservation and Use: I Saved the Files But Can I Run ...NISO Webinar: Software Preservation and Use: I Saved the Files But Can I Run ...
NISO Webinar: Software Preservation and Use: I Saved the Files But Can I Run ...
 
Managing files chapter 7
Managing files chapter 7 Managing files chapter 7
Managing files chapter 7
 
Managing files chapter 7
Managing files chapter 7 Managing files chapter 7
Managing files chapter 7
 
R&D on PVS-Studio
R&D on PVS-StudioR&D on PVS-Studio
R&D on PVS-Studio
 
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docx
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docxCS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docx
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docx
 
File handling.pptx
File handling.pptxFile handling.pptx
File handling.pptx
 
Reverse Engineering in Linux - The tools showcase
Reverse Engineering in Linux - The tools showcaseReverse Engineering in Linux - The tools showcase
Reverse Engineering in Linux - The tools showcase
 
FTK report PART I Familiar with FTK ImagerBonus Exerc.docx
FTK report PART I Familiar with FTK ImagerBonus Exerc.docxFTK report PART I Familiar with FTK ImagerBonus Exerc.docx
FTK report PART I Familiar with FTK ImagerBonus Exerc.docx
 
Lpi Part 2 Basic Administration
Lpi Part 2 Basic AdministrationLpi Part 2 Basic Administration
Lpi Part 2 Basic Administration
 
Reproducibility: 10 Simple Rules
Reproducibility: 10 Simple RulesReproducibility: 10 Simple Rules
Reproducibility: 10 Simple Rules
 
file+not+too+large
file+not+too+largefile+not+too+large
file+not+too+large
 
1.0 QuickBooks Fundementals : Day 02 Windows :2.1 windows
1.0 QuickBooks Fundementals : Day 02 Windows :2.1 windows1.0 QuickBooks Fundementals : Day 02 Windows :2.1 windows
1.0 QuickBooks Fundementals : Day 02 Windows :2.1 windows
 
Debugging
DebuggingDebugging
Debugging
 
Internal lunchtime-learning--2013 jan22--data management
Internal lunchtime-learning--2013 jan22--data managementInternal lunchtime-learning--2013 jan22--data management
Internal lunchtime-learning--2013 jan22--data management
 
Ten Myths About Deleted Files
Ten Myths About Deleted FilesTen Myths About Deleted Files
Ten Myths About Deleted Files
 
Ten Myths About Recovery Deleted Files
Ten Myths About Recovery Deleted FilesTen Myths About Recovery Deleted Files
Ten Myths About Recovery Deleted Files
 
Chapter - 5.pptx
Chapter - 5.pptxChapter - 5.pptx
Chapter - 5.pptx
 

More from aadeshwarexports

Problem Solvinf Activity Fer each response 17 State whethe.pdf
Problem Solvinf Activity Fer each response 17 State whethe.pdfProblem Solvinf Activity Fer each response 17 State whethe.pdf
Problem Solvinf Activity Fer each response 17 State whethe.pdfaadeshwarexports
 
Problem Random variable XY is Gaussian with mean Y varianc.pdf
Problem Random variable XY is Gaussian with mean Y varianc.pdfProblem Random variable XY is Gaussian with mean Y varianc.pdf
Problem Random variable XY is Gaussian with mean Y varianc.pdfaadeshwarexports
 
Problem A pair of dice is thrown are the random variable z .pdf
Problem A pair of dice is thrown are the random variable z .pdfProblem A pair of dice is thrown are the random variable z .pdf
Problem A pair of dice is thrown are the random variable z .pdfaadeshwarexports
 
Problem AIFS is thinking about hedging risk of hotel book.pdf
Problem AIFS is thinking about hedging risk of hotel book.pdfProblem AIFS is thinking about hedging risk of hotel book.pdf
Problem AIFS is thinking about hedging risk of hotel book.pdfaadeshwarexports
 
Problem B Cont of the Problem A Now after you learned and .pdf
Problem B Cont of the Problem A Now after you learned and .pdfProblem B Cont of the Problem A Now after you learned and .pdf
Problem B Cont of the Problem A Now after you learned and .pdfaadeshwarexports
 
Problem 9 Calculating N i5.pdf
Problem 9 Calculating N i5.pdfProblem 9 Calculating N i5.pdf
Problem 9 Calculating N i5.pdfaadeshwarexports
 
Problem 8T2 The code below attached to the Lab 7 is tem.pdf
Problem 8T2 The code below attached to the Lab 7 is tem.pdfProblem 8T2 The code below attached to the Lab 7 is tem.pdf
Problem 8T2 The code below attached to the Lab 7 is tem.pdfaadeshwarexports
 
Problem 723 Stock Valuation LO 1 Youve collected the fol.pdf
Problem 723 Stock Valuation LO 1 Youve collected the fol.pdfProblem 723 Stock Valuation LO 1 Youve collected the fol.pdf
Problem 723 Stock Valuation LO 1 Youve collected the fol.pdfaadeshwarexports
 
Problem 62 The historical annual returns of stocks X and Y.pdf
Problem 62 The historical annual returns of stocks X and Y.pdfProblem 62 The historical annual returns of stocks X and Y.pdf
Problem 62 The historical annual returns of stocks X and Y.pdfaadeshwarexports
 
Problem 6 20 Points Sketch the output waveforms Q1Q2Q3.pdf
Problem 6 20 Points Sketch the output waveforms Q1Q2Q3.pdfProblem 6 20 Points Sketch the output waveforms Q1Q2Q3.pdf
Problem 6 20 Points Sketch the output waveforms Q1Q2Q3.pdfaadeshwarexports
 
Problem 53 The historical annual returns of a stock are Y.pdf
Problem 53 The historical annual returns of a stock are Y.pdfProblem 53 The historical annual returns of a stock are Y.pdf
Problem 53 The historical annual returns of a stock are Y.pdfaadeshwarexports
 
Problem 4 Two continuous random variables X and Y have a jo.pdf
Problem 4 Two continuous random variables X and Y have a jo.pdfProblem 4 Two continuous random variables X and Y have a jo.pdf
Problem 4 Two continuous random variables X and Y have a jo.pdfaadeshwarexports
 
PROBLEM 4 Honoring Buzz Function Name fancyBuzz Paramet.pdf
PROBLEM 4 Honoring Buzz Function Name fancyBuzz Paramet.pdfPROBLEM 4 Honoring Buzz Function Name fancyBuzz Paramet.pdf
PROBLEM 4 Honoring Buzz Function Name fancyBuzz Paramet.pdfaadeshwarexports
 
Problem 4 Closing Entries 22 points Following is an alph.pdf
Problem 4 Closing Entries  22 points Following is an alph.pdfProblem 4 Closing Entries  22 points Following is an alph.pdf
Problem 4 Closing Entries 22 points Following is an alph.pdfaadeshwarexports
 
Problem 4Lexical Semantics The WordNet entry for the nouns .pdf
Problem 4Lexical Semantics The WordNet entry for the nouns .pdfProblem 4Lexical Semantics The WordNet entry for the nouns .pdf
Problem 4Lexical Semantics The WordNet entry for the nouns .pdfaadeshwarexports
 
Problem 5 4 pts each part Let A be the language accepted.pdf
Problem 5  4 pts each part Let A be the language accepted.pdfProblem 5  4 pts each part Let A be the language accepted.pdf
Problem 5 4 pts each part Let A be the language accepted.pdfaadeshwarexports
 
Problem 4 IP Routing Table Design 20 pts Consider an IP n.pdf
Problem 4 IP Routing Table Design 20 pts Consider an IP n.pdfProblem 4 IP Routing Table Design 20 pts Consider an IP n.pdf
Problem 4 IP Routing Table Design 20 pts Consider an IP n.pdfaadeshwarexports
 
Problem 4 Buffons needle problem 20 points graded on ac.pdf
Problem 4 Buffons needle problem 20 points graded on ac.pdfProblem 4 Buffons needle problem 20 points graded on ac.pdf
Problem 4 Buffons needle problem 20 points graded on ac.pdfaadeshwarexports
 
Problem 4 Budgeting Time for Chilling Consider the followin.pdf
Problem 4 Budgeting Time for Chilling Consider the followin.pdfProblem 4 Budgeting Time for Chilling Consider the followin.pdf
Problem 4 Budgeting Time for Chilling Consider the followin.pdfaadeshwarexports
 
Problem 4 Category OPTIONAL Design Design a PDA to rec.pdf
Problem 4 Category OPTIONAL Design  Design a PDA to rec.pdfProblem 4 Category OPTIONAL Design  Design a PDA to rec.pdf
Problem 4 Category OPTIONAL Design Design a PDA to rec.pdfaadeshwarexports
 

More from aadeshwarexports (20)

Problem Solvinf Activity Fer each response 17 State whethe.pdf
Problem Solvinf Activity Fer each response 17 State whethe.pdfProblem Solvinf Activity Fer each response 17 State whethe.pdf
Problem Solvinf Activity Fer each response 17 State whethe.pdf
 
Problem Random variable XY is Gaussian with mean Y varianc.pdf
Problem Random variable XY is Gaussian with mean Y varianc.pdfProblem Random variable XY is Gaussian with mean Y varianc.pdf
Problem Random variable XY is Gaussian with mean Y varianc.pdf
 
Problem A pair of dice is thrown are the random variable z .pdf
Problem A pair of dice is thrown are the random variable z .pdfProblem A pair of dice is thrown are the random variable z .pdf
Problem A pair of dice is thrown are the random variable z .pdf
 
Problem AIFS is thinking about hedging risk of hotel book.pdf
Problem AIFS is thinking about hedging risk of hotel book.pdfProblem AIFS is thinking about hedging risk of hotel book.pdf
Problem AIFS is thinking about hedging risk of hotel book.pdf
 
Problem B Cont of the Problem A Now after you learned and .pdf
Problem B Cont of the Problem A Now after you learned and .pdfProblem B Cont of the Problem A Now after you learned and .pdf
Problem B Cont of the Problem A Now after you learned and .pdf
 
Problem 9 Calculating N i5.pdf
Problem 9 Calculating N i5.pdfProblem 9 Calculating N i5.pdf
Problem 9 Calculating N i5.pdf
 
Problem 8T2 The code below attached to the Lab 7 is tem.pdf
Problem 8T2 The code below attached to the Lab 7 is tem.pdfProblem 8T2 The code below attached to the Lab 7 is tem.pdf
Problem 8T2 The code below attached to the Lab 7 is tem.pdf
 
Problem 723 Stock Valuation LO 1 Youve collected the fol.pdf
Problem 723 Stock Valuation LO 1 Youve collected the fol.pdfProblem 723 Stock Valuation LO 1 Youve collected the fol.pdf
Problem 723 Stock Valuation LO 1 Youve collected the fol.pdf
 
Problem 62 The historical annual returns of stocks X and Y.pdf
Problem 62 The historical annual returns of stocks X and Y.pdfProblem 62 The historical annual returns of stocks X and Y.pdf
Problem 62 The historical annual returns of stocks X and Y.pdf
 
Problem 6 20 Points Sketch the output waveforms Q1Q2Q3.pdf
Problem 6 20 Points Sketch the output waveforms Q1Q2Q3.pdfProblem 6 20 Points Sketch the output waveforms Q1Q2Q3.pdf
Problem 6 20 Points Sketch the output waveforms Q1Q2Q3.pdf
 
Problem 53 The historical annual returns of a stock are Y.pdf
Problem 53 The historical annual returns of a stock are Y.pdfProblem 53 The historical annual returns of a stock are Y.pdf
Problem 53 The historical annual returns of a stock are Y.pdf
 
Problem 4 Two continuous random variables X and Y have a jo.pdf
Problem 4 Two continuous random variables X and Y have a jo.pdfProblem 4 Two continuous random variables X and Y have a jo.pdf
Problem 4 Two continuous random variables X and Y have a jo.pdf
 
PROBLEM 4 Honoring Buzz Function Name fancyBuzz Paramet.pdf
PROBLEM 4 Honoring Buzz Function Name fancyBuzz Paramet.pdfPROBLEM 4 Honoring Buzz Function Name fancyBuzz Paramet.pdf
PROBLEM 4 Honoring Buzz Function Name fancyBuzz Paramet.pdf
 
Problem 4 Closing Entries 22 points Following is an alph.pdf
Problem 4 Closing Entries  22 points Following is an alph.pdfProblem 4 Closing Entries  22 points Following is an alph.pdf
Problem 4 Closing Entries 22 points Following is an alph.pdf
 
Problem 4Lexical Semantics The WordNet entry for the nouns .pdf
Problem 4Lexical Semantics The WordNet entry for the nouns .pdfProblem 4Lexical Semantics The WordNet entry for the nouns .pdf
Problem 4Lexical Semantics The WordNet entry for the nouns .pdf
 
Problem 5 4 pts each part Let A be the language accepted.pdf
Problem 5  4 pts each part Let A be the language accepted.pdfProblem 5  4 pts each part Let A be the language accepted.pdf
Problem 5 4 pts each part Let A be the language accepted.pdf
 
Problem 4 IP Routing Table Design 20 pts Consider an IP n.pdf
Problem 4 IP Routing Table Design 20 pts Consider an IP n.pdfProblem 4 IP Routing Table Design 20 pts Consider an IP n.pdf
Problem 4 IP Routing Table Design 20 pts Consider an IP n.pdf
 
Problem 4 Buffons needle problem 20 points graded on ac.pdf
Problem 4 Buffons needle problem 20 points graded on ac.pdfProblem 4 Buffons needle problem 20 points graded on ac.pdf
Problem 4 Buffons needle problem 20 points graded on ac.pdf
 
Problem 4 Budgeting Time for Chilling Consider the followin.pdf
Problem 4 Budgeting Time for Chilling Consider the followin.pdfProblem 4 Budgeting Time for Chilling Consider the followin.pdf
Problem 4 Budgeting Time for Chilling Consider the followin.pdf
 
Problem 4 Category OPTIONAL Design Design a PDA to rec.pdf
Problem 4 Category OPTIONAL Design  Design a PDA to rec.pdfProblem 4 Category OPTIONAL Design  Design a PDA to rec.pdf
Problem 4 Category OPTIONAL Design Design a PDA to rec.pdf
 

Recently uploaded

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 

Recently uploaded (20)

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 

Problem How do you copy a file Analyze the problem and con.pdf

  • 1. Problem: How do you copy a file? Analyze the problem and consider alternate solutions: Objective: reproduce a file. Elements: (output) newfile, (input) oldfile Relations: copy,reproduce, create a copy, photocopy, ... Algorithm: ? 1 2 3 4 5 6 7 8 9 10 11 12 determine which file to copy from find the oldfile if cannot find oldfile, ???? else continue determine which file to copy to find the newfile if newfile exists, ????? else continue prepare (open) oldfile prepare (open) newfile transfer data from oldfile to newfile put away (close) oldfile put away (close) newfile display the outcome Note that our pseudocode is generic enough to follow a manual or a computerized process. To construct a solution in the bash environment, we need to do some preparations: 1. Create a file for each script (do not get into the habit of just adding to the same file - one solution, one file). For each variation (version), copy the current file to a file that identifies the version. For example: ~$ mkdir bin ~$ cd bin ~/bin$ vi copy . . .
  • 2. ~/bin$ cp copy copy.verA ~/bin$ vi copy . . . ~/bin$ cp copy copy.verB ...and so on. 2. In your ~/bin directory (as demonstrated above), create a file called "copy", enter the code as shown below, save the file and change the permissions so that you can execute the file. ~/bin$ vi copy ~/bin$ chmod 705 copy 3. Learn more about bash shell by examining the manual page: man bash Let's return to the problem. From modelling example solutions, a number of questions should come to mind, such as What is a file? regular file? directory? special file? Where do these values come from? are they chosen arbitrarily, by the user, by another program? Identify other relevant information. Identify and describe uncertainties about the interpretation of the problem. Let's examine what happens to our solution as we make different assumptions about the problem Stop and analyze: Explore other alternatives and related assumptions. Explore the implications of ambiguities when analysing a problem. Consider the impact of alternative solutions on various types of users. Plan and document how to test potential solutions. Recognize and control your own biases when choosing a solution. Version A: ....the first version is incomplete, yet provides a wealth of information that we address one step at a time. r/bin$ copy 1 2 3 4 5 6 7 8 9 10 11 12 determine which file to copy from find the oldfile if cannot find oldfile, ???? else continue determine which file to copy to find the newfile if newfile exists, ????? else continue prepare (open) oldfile prepare (open) newfile transfer data from oldfile to newfile put away (close) oldfile put away (close) newfile display the outcome