RosettaCodeData/Task/File-size/PL-I/file-size.pli

27 lines
755 B
Plaintext

/* To obtain file size of files in root as well as from current directory. */
test: proc options (main);
declare ch character (1);
declare i fixed binary (31);
declare in1 file record;
/* Open a file in the root directory. */
open file (in1) title ('//asd.log,type(fixed),recsize(1)');
on endfile (in1) go to next1;
do i = 0 by 1;
read file (in1) into (ch);
end;
next1:
put skip list ('file size in root directory =' || trim(i));
close file (in1);
/* Open a file in the current dorectory. */
open file (in1) title ('/asd.txt,type(fixed),recsize(1)');
on endfile (in1) go to next2;
do i = 0 by 1;
read file (in1) into (ch);
end;
next2:
put skip list ('local file size=' || trim(i));
end test;