Skip to content

Just proxy/adapter/decorator classes to 4D File and Folder

License

Notifications You must be signed in to change notification settings

mesopelagique/FileAndFolder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileAndFolder

Just proxy/adapter classes to 4D File and Folder

⚠️ could be completed with this https://github.com/mesopelagique/GetSetWrappers/blob/master/Project/Sources/Classes/File.4dm

Handle

Read files

Read by line

var $handle : cs.FileHandle
$handle:=$file.open("r")
var $line : Text
Repeat 
    $line:=$handle.readLine()
Until (OK=0)
$handle.close()// do it always

Write

var $handle : cs.FileHandle
$handle:=$file.open("w")
If (Asserted($handle#Null; "cannot open"))
	ON ERR CALL("try")
	$handle.write("test")
	$handle.write("test")
	
	ON ERR CALL("")
	$handle.close() // do it always
End if

Write At the end

var $handle : cs.FileHandle
$handle:=$file.open("a")
If (Asserted($handle#Null; "cannot open"))
	ON ERR CALL("try")
	$handle.write("test")
	$handle.write("test")
	
	ON ERR CALL("")
	$handle.close() // do it always
End if

About

Just proxy/adapter/decorator classes to 4D File and Folder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published