2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1 +1,5 @@
|
|||
In this task, the job is to delete a file called "input.txt" and delete a directory called "docs". This should be done twice: once "here", i.e. in the current working directory and once in the filesystem root.
|
||||
;Task:
|
||||
Delete a file called "input.txt" and delete a directory called "docs".
|
||||
|
||||
This should be done twice: once "here", i.e. in the current working directory and once in the filesystem root.
|
||||
<br><br>
|
||||
|
|
|
|||
1
Task/Delete-a-file/BASIC/delete-a-file-3.basic
Normal file
1
Task/Delete-a-file/BASIC/delete-a-file-3.basic
Normal file
|
|
@ -0,0 +1 @@
|
|||
ERASE "a:INPUTTXT"
|
||||
13
Task/Delete-a-file/Elena/delete-a-file.elena
Normal file
13
Task/Delete-a-file/Elena/delete-a-file.elena
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#import system.
|
||||
#import system'io.
|
||||
|
||||
#symbol program =
|
||||
[
|
||||
"output.txt" file_path delete.
|
||||
|
||||
"\output.txt" file_path delete.
|
||||
|
||||
"docs" directory_path delete.
|
||||
|
||||
"\docs" directory_path delete.
|
||||
].
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
OPEN (UNIT=5, FILE="input.txt", STATUS="OLD") ! Current directory
|
||||
CLOSE (UNIT=5, STATUS="DELETE")
|
||||
OPEN (UNIT=5, FILE="/input.txt", STATUS="OLD") ! Root directory
|
||||
CLOSE (UNIT=5, STATUS="DELETE")
|
||||
OPEN (UNIT=5, FILE="input.txt", STATUS="OLD") ! Current directory
|
||||
CLOSE (UNIT=5, STATUS="DELETE")
|
||||
OPEN (UNIT=5, FILE="/input.txt", STATUS="OLD") ! Root directory
|
||||
CLOSE (UNIT=5, STATUS="DELETE")
|
||||
|
|
|
|||
2
Task/Delete-a-file/JavaScript/delete-a-file-3.js
Normal file
2
Task/Delete-a-file/JavaScript/delete-a-file-3.js
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
const fs = require('fs');
|
||||
fs.unlinkSync('myfile.txt');
|
||||
4
Task/Delete-a-file/JavaScript/delete-a-file-4.js
Normal file
4
Task/Delete-a-file/JavaScript/delete-a-file-4.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
const fs = require('fs');
|
||||
fs.unlink('myfile.txt', ()=>{
|
||||
console.log("Done!");
|
||||
})
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
/*REXX pgm deletes a file & a folder in the current directory & the root*/
|
||||
trace off /*suppress REXX error messages. */
|
||||
aFile= 'input.txt' /*name of a file to be deleted.*/
|
||||
aDir = 'docs' /*name of a folder to be removed.*/
|
||||
do j=1 for 2 /*perform this DO loop twice. */
|
||||
'ERASE' aFile /*erase this file in the cur dir*/
|
||||
'RMDIR' "/s /q" aDir /*remove the folder " " " " */
|
||||
if j==1 then 'CD \' /*make current dir the root dir.*/
|
||||
end /* [↑] just do CD \ once.*/
|
||||
/*stick a fork in it, we're done.*/
|
||||
/*REXX program deletes a file and a folder in the current directory and the root. */
|
||||
trace off /*suppress REXX error messages from DOS*/
|
||||
aFile= 'input.txt' /*name of a file to be deleted. */
|
||||
aDir = 'docs' /*name of a folder to be removed. */
|
||||
do j=1 for 2 /*perform this DO loop exactly twice.*/
|
||||
'ERASE' aFile /*erase this file in the current dir. */
|
||||
'RMDIR' "/s /q" aDir /*remove the folder " " " " */
|
||||
if j==1 then 'CD \' /*make the current dir the root dir.*/
|
||||
end /* [↑] just do CD \ command once.*/
|
||||
/*stick a fork in it, we're all done. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue