writer class : writer(string,bool) fitter

Description

Gets a new instance of writer class which is initialized with the file path and writing mode.

Syntax

new writer(string fullPath, bool append)

Arguments

ClassNameDescription
stringfullPathThe complete file path.
boolappendA value that indicates the writing mode.

Return value

ClassDescription
writerA new instance of writer class that is initialized by specified value.

Sample code

1:

writer w = new writer("c:\somewhere...\sample.txt", true);

Notes

It's a wrapper of the System.IO.StreamWriter.StreamWriter(String,Boolean) constructor.

This fitter creates a instance of Writer class with UTF-8 encoding without a Byte-Order Mark (BOM).

If sets the true to the second argument, the instance of writer class is initialized as append mode. Otherwise, it is initialized as overwrite mode.

Links for reference

Copyright © Cooker All rights reserved.