Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -0,0 +1,17 @@
# usage: awk -f filesize.awk -v fn=input.txt
BEGIN { # Filesize on Unix, using ls
#system("ls -l")
if(!fn) fn ="input.txt"
cmd="ls -l " fn
print "#", cmd
system(cmd)
cmd | getline x
close(cmd)
#print x
n=split(x,stat," ")
#for (i in stat) {print i, stat[i] }
print "file:", stat[9], "size:", stat[5]
}

View file

@ -0,0 +1 @@
FileTools:-Size( "input.txt" )

View file

@ -0,0 +1 @@
FileTools:-Size( "/input.txt" )

View file

@ -1,9 +0,0 @@
function GetFileSize( filename )
local fp = io.open( filename )
if fp == nil then
return nil
end
local filesize = fp:seek( "end" )
fp:close()
return filesize
end

View file

@ -0,0 +1,2 @@
(println (first (file-info "input.txt")))
(println (first (file-info "/input.txt")))

View file

@ -0,0 +1,8 @@
import java.io.File
object FileSize extends App {
val name = "pg1661.txt"
println(s"$name : ${new File(name).length()} bytes")
println(s"/$name : ${new File(s"${File.separator}$name").length()} bytes")
}

View file

@ -1,2 +1,10 @@
size1=$(wc -c < input.txt | tr -d ' ')
size2=$(wc -c < /input.txt | tr -d ' ')
echo "# ls:"
ls -la input.txt
echo "# stat:"
stat input.txt
echo "# Size:"
size1=$(ls -l input.txt | tr -s ' ' | cut -d ' ' -f 5)
size2=$(wc -c < input.txt | tr -d ' ')
echo $size1, $size2

View file

@ -1,2 +1,2 @@
size1=$(stat -f %z input.txt)
size2=$(stat -f %z /input.txt)
size1=$(wc -c < input.txt | tr -d ' ')
size2=$(wc -c < /input.txt | tr -d ' ')

View file

@ -1,5 +1,2 @@
# from module 'zsh/stat', load builtin 'zstat'
zmodload -F zsh/stat b:zstat
size1=$(zstat +size input.txt)
size2=$(zstat +size /input.txt)
size1=$(stat -f %z input.txt)
size2=$(stat -f %z /input.txt)

View file

@ -0,0 +1,5 @@
# from module 'zsh/stat', load builtin 'zstat'
zmodload -F zsh/stat b:zstat
size1=$(zstat +size input.txt)
size2=$(zstat +size /input.txt)