Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,5 @@
If GetCalc("appvINPUT")→I
Disp {I-2}ʳ▶Dec,i
Else
Disp "NOT FOUND",i
End

View file

@ -0,0 +1,6 @@
' FB 1.05.0 Win64
#include "file.bi"
Print FileLen("input.txt"), FileLen(Environ("SystemRoot") + "\input.txt")
Sleep

View file

@ -0,0 +1,9 @@
// local to current directory
local(f = file('input.txt'))
handle => { #f->close }
#f->size
// file at file system root
local(f = file('//input.txt'))
handle => { #f->close }
#f->size

View file

@ -0,0 +1,13 @@
----------------------------------------
-- Returns file size
-- @param {string} filename
-- @return {integer}
----------------------------------------
on getFileSize (filename)
fp = xtra("fileIO").new()
fp.openFile(filename, 1)
if fp.status() then return 0
len = fp.getLength()
fp.closeFile()
return len
end

View file

@ -0,0 +1,20 @@
// root folder
set the defaultfolder to "/"
repeat for each line fline in (the detailed files)
if item 1 of fline is "input.txt" then
put item 2 of fline --bytes
exit repeat
end if
end repeat
// current working dir of stack
put the effective filename of this stack into tPath
set the itemDelimiter to slash
delete last item of tPath
set the defaultfolder to tPath
repeat for each line fline in (the detailed files)
if item 1 of fline is "input.txt" then
put item 2 of fline
exit repeat
end if
end repeat

View file

@ -0,0 +1,3 @@
import os
echo getFileSize "input.txt"
echo getFileSize "/input.txt"

View file

@ -0,0 +1,2 @@
File new("input.txt") size println
File new("/input.txt") size println

View file

@ -0,0 +1,17 @@
function file_size(sequence file_name)
object d = dir(file_name)
if atom(d) or length(d)!=1 then return -1 end if
return d[1][D_SIZE]
end function
procedure test(sequence file_name)
integer size = file_size(file_name)
if size<0 then
printf(1,"%s file does not exist.\n",{file_name})
else
printf(1,"%s size is %d.\n",{file_name,size})
end if
end procedure
test("input.txt") -- in the current working directory
test("/input.txt") -- in the file system root

View file

@ -0,0 +1,2 @@
See len(read('input.txt')) + nl
see len(read('/input.txt')) + nl

View file

@ -0,0 +1,2 @@
say (Dir.cwd + %f'input.txt' -> size);
say (Dir.root + %f'input.txt' -> size);

View file

@ -0,0 +1,9 @@
decl file f
f.open "input.txt"
out (size f) endl console
f.close
f.open "/input.txt"
out (size f) endl console
f.close

View file

@ -0,0 +1,3 @@
jq -Rs length input.txt
jq -Rs length /input.txt