June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1,18 +1,12 @@
|
|||
BEGIN {
|
||||
|
||||
# Windows
|
||||
out = system2var("for %I in (input.txt) do @echo %~zI")
|
||||
printf("input.txt\t%s\n", out)
|
||||
out = system2var("for %I in (\input.txt) do @echo %~zI")
|
||||
printf("\input.txt\t%s\n", out)
|
||||
printf("input.txt\t%s\n", system2var("for %I in (input.txt) do @echo %~zI"))
|
||||
printf("\input.txt\t%s\n", system2var("for %I in (\input.txt) do @echo %~zI"))
|
||||
|
||||
# Non-Windows
|
||||
out = getline2var("ls -l input.txt")
|
||||
split(out, size, " ")
|
||||
printf("input.txt\t%s\n", size[5])
|
||||
out = getline2var("ls -l /input.txt")
|
||||
split(out, size, " ")
|
||||
printf("/input.txt\t%s\n", size[5])
|
||||
printf("input.txt\t%s\n", getline2var("stat --printf=\"%s\" input.txt"))
|
||||
printf("/input.txt\t%s\n", getline2var("stat --printf=\"%s\" /input.txt"))
|
||||
}
|
||||
|
||||
# Windows system() method
|
||||
|
|
|
|||
9
Task/File-size/Fortran/file-size-1.f
Normal file
9
Task/File-size/Fortran/file-size-1.f
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use :: iso_fortran_env, only : FILE_STORAGE_SIZE
|
||||
implicit none
|
||||
character(len=*),parameter :: filename(*)=[character(len=256) :: 'input.txt', '/input.txt']
|
||||
integer :: file_size, i
|
||||
do i=1,size(filename)
|
||||
INQUIRE(FILE=filename(i), SIZE=file_size) ! return -1 if cannot determine file size
|
||||
write(*,*)'size of file '//trim(filename(i))//' is ',file_size * FILE_STORAGE_SIZE /8,' bytes'
|
||||
enddo
|
||||
end
|
||||
4
Task/File-size/Red/file-size.red
Normal file
4
Task/File-size/Red/file-size.red
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
>> size? %input.txt
|
||||
== 39244
|
||||
>> size? %/c/input.txt
|
||||
== 39244
|
||||
Loading…
Add table
Add a link
Reference in a new issue