Lib_jsr75ex-  
  jsr75;
    , 
   Pascal.

JAVA:

public static int no_files()
public static String findfirst(String target)
public static String findnext()
public static int mkdir(String target)
public static int is_directory(String target)
public static int directory_size(String target)
public static int file_size(String target)
public static int available_size(String target)
public static int total_size(String target)
public static int used_size(String target)
public static int can_read(String target)
public static int can_write(String target)
public static int is_hidden(String target)
public static int rename(String old,String target)
public static void set_hidden(String target,int flag)
public static int file_exists(String target)

PASCAL:

function no_files:integer;
function findfirst(target:string):string;
function findnext:string;
function mkdir(target:string):integer;
function is_directory(target:string):integer;
function directory_size(target:string):integer;
function file_size(target:string):integer;
function available_size(target:string):integer;
function total_size(target:string):integer;
function used_size(target:string):integer;
function can_read(target:string):integer;
function can_write(target:string):integer;
function is_hidden(target:string):integer;
function rename(old:string;target:string):integer;
function file_exists(target:string):integer;
proceure set_hidden(target:string;flag:integer);


 set_hidden / 
"" .
 flag    1  0, 
1- , 0-.

 
function directory_size(target:string):integer;
function file_size(target:string):integer;
function available_size(target:string):integer;
function total_size(target:string):integer;
function used_size(target:string):integer;
 : 
  target
  target
    target
   target
    target


function no_files:integer;
function findfirst(target:string):string;
function findnext:string;
     target
 
no_files  1     
   0     

function findfirst(target:string):string; 
    target 
    
 
function findnext:string;
       
(no_files  1  findnext  '')
    /

function is_directory(target:string):integer;
,   target 
 1    0  


function can_read(target:string):integer;
function can_write(target:string):integer;
,   target  /
 1    0  

function is_hidden(target:string):integer;
,   target 
 1    0  


function rename(old:string;target:string):integer;
 /? old( c:/file.txt)target
( name.txt)  1    
 0   


function mkdir(target:string):integer;
  target
 1    
 0   

 function file_exists(target:string):integer;
 1  ,   target , 
  0.

:
   
<drive>:/
   
<drive>:/dir/
   
<drive>:/dir/file.txt
 ! 


    
  
!    
  .

!
  
   !

function file_open(path):integer;
  path
: 1-, 0- .
path   root/folder/file.ext

function open_outstream:integer
  .
      .
: 1-, 0- .

function open_instream:integer
  .
      .
: 1-, 0- .

function file_write_byte(data:integer):integer;
  data  .
: 1-, 0- .

function file_read_byte:integer;
   .
:     0,  .

function stream_sz:integer;
:     0,  .
   open_instream.

function file_close:integer;
     .        .
: 1-, 0- .


     

procedure onerror(src,msg:string);
begin

end;
     .
src -   ,  ,
msg -   (Excaption.toString).

    3.1 (   *_s,  ).

    :

program jsr75ex4test;
uses jsr75ex4;

const
 path = 'root1/test.dat';

var
 i:integer;
 r:integer;
 y:integer;
 sz:integer;
 cmOk:command;
 
procedure onerror(src,msg:string);
begin
 showform;
 cmOK:=CreateCommand('OK',CM_OK,1);
 ShowAlert(src,msg, LoadImage('/icon.png'),ALERT_ERROR);
 delay(20000);
 Showcanvas;
end;

begin
	r:=jsr75ex4.file_open(path);
	r:=open_outstream;
	for i:= 1 to 20 do
	  r:=file_write_byte(i);
	r:=file_close;
	DrawText('Done',0,0);
	y:=10;
	repaint;
	
	r:=file_open(path);
	r:=open_instream;
	sz:=stream_sz;
	DrawText(''+sz,0,y);
	repaint;
	y:=y+10;
	for i:=1 to sz do
	begin
		r:=file_read_byte;
		DrawText(''+r,0,y);
		repaint;
		y:=y+10;
  end;
  r:=file_close;
  DrawText('closed',0,y);
  repaint;
	delay(10000);	
	
end.