Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
14
Task/Rename-a-file/FreeBASIC/rename-a-file.freebasic
Normal file
14
Task/Rename-a-file/FreeBASIC/rename-a-file.freebasic
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
Dim result As Long
|
||||
result = Name("input.txt", "output.txt")
|
||||
If result <> 0 Then
|
||||
Print "Renaming file failed"
|
||||
End If
|
||||
|
||||
result = Name("docs", "mydocs")
|
||||
If result <> 0 Then
|
||||
Print "Renaming directory failed"
|
||||
End If
|
||||
|
||||
Sleep
|
||||
5
Task/Rename-a-file/Harbour/rename-a-file.harbour
Normal file
5
Task/Rename-a-file/Harbour/rename-a-file.harbour
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
FRename( "input.txt","output.txt")
|
||||
// or
|
||||
RENAME input.txt TO output.txt
|
||||
|
||||
FRename( hb_ps() + "input.txt", hb_ps() + "output.txt")
|
||||
4
Task/Rename-a-file/LFE/rename-a-file.lfe
Normal file
4
Task/Rename-a-file/LFE/rename-a-file.lfe
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(file:rename "input.txt" "output.txt")
|
||||
(file:rename "docs" "mydocs")
|
||||
(file:rename "/input.txt" "/output.txt")
|
||||
(file:rename "/docs" "/mydocs")
|
||||
17
Task/Rename-a-file/Lasso/rename-a-file.lasso
Normal file
17
Task/Rename-a-file/Lasso/rename-a-file.lasso
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// move file
|
||||
local(f = file('input.txt'))
|
||||
#f->moveTo('output.txt')
|
||||
#f->close
|
||||
|
||||
// move directory, just like a file
|
||||
local(d = dir('docs'))
|
||||
#d->moveTo('mydocs')
|
||||
|
||||
// move file in root file system (requires permissions at user OS level)
|
||||
local(f = file('//input.txt'))
|
||||
#f->moveTo('//output.txt')
|
||||
#f->close
|
||||
|
||||
// move directory in root file system (requires permissions at user OS level)
|
||||
local(d = file('//docs'))
|
||||
#d->moveTo('//mydocs')
|
||||
4
Task/Rename-a-file/LiveCode/rename-a-file.livecode
Normal file
4
Task/Rename-a-file/LiveCode/rename-a-file.livecode
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
rename file "input.txt" to "output.txt"
|
||||
rename folder "docs" to "mydocs"
|
||||
rename file "/input.txt" to "/output.txt"
|
||||
rename folder "/docs" to "/mydocs"
|
||||
7
Task/Rename-a-file/Nim/rename-a-file.nim
Normal file
7
Task/Rename-a-file/Nim/rename-a-file.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import os
|
||||
|
||||
moveFile("input.txt", "output.txt")
|
||||
moveFile("docs", "mydocs")
|
||||
|
||||
moveFile(DirSep & "input.txt", DirSep & "output.txt")
|
||||
moveFile(DirSep & "docs", DirSep & "mydocs")
|
||||
4
Task/Rename-a-file/Ring/rename-a-file.ring
Normal file
4
Task/Rename-a-file/Ring/rename-a-file.ring
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
rename("input.txt", "output.txt")
|
||||
rename("docs", "mydocs")
|
||||
rename("/input.txt", "/output.txt")
|
||||
rename("/docs", "/mydocs")
|
||||
7
Task/Rename-a-file/Sidef/rename-a-file.sidef
Normal file
7
Task/Rename-a-file/Sidef/rename-a-file.sidef
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Here
|
||||
File.rename('input.txt', 'output.txt');
|
||||
File.rename('docs', 'mydocs');
|
||||
|
||||
# Root dir
|
||||
File.rename(Dir.root + %f'input.txt', Dir.root + %f'output.txt');
|
||||
File.rename(Dir.root + %f'docs', Dir.root + %f'mydocs');
|
||||
Loading…
Add table
Add a link
Reference in a new issue