XLF

From Unify Community Wiki
Jump to: navigation, search

X-Language-File

By 4D Interactive Studio

XLF is a class to read and write files.


IO.js

<javascript>

import System.IO;

class IO { // ------------------------------ File ------------------------------ //

public static function ExistsFile ( url : String ) { var info : FileInfo = new FileInfo ( url );

return info.Exists; }

public static function RemoveFile ( url : String ) { var info : FileInfo = new FileInfo ( url );

if ( info.Exists ) info.Delete ( ); }

public static function WriteFile ( url : String, string : String ) { var writer : StreamWriter; var info : FileInfo = new FileInfo ( url );

if ( info.Exists ) info.Delete ( );

writer = info.CreateText ( );

writer.Write ( string ); writer.Close ( ); }

public static function ReadFile ( url : String ) { var info : FileInfo = new FileInfo ( url );

if ( ! info.Exists ) return "";

var reader : StreamReader = File.OpenText ( url ); var readedString : String = reader.ReadToEnd ( );

reader.Close ( );

return readedString; } }

</javascript>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox