Compare Revisions

File I/O

Change Revisions

Revision 520753:

Revision 520753 by Noitidart on

Revision 520755:

Revision 520755 by Noitidart on

Title:
File I/O
File I/O
Slug:
Mozilla/Add-ons/Code_snippets/File_I_O
Mozilla/Add-ons/Code_snippets/File_I_O
Tags:
"Files", "Extensions", "Add-ons", "Code snippets", "Streams"
"Files", "Extensions", "Add-ons", "Code snippets", "Streams"
Content:

Revision 520753
Revision 520755
n519    <h5 name="More">n519    <h5 id="More" name="More">
n558    <p>n
559      &nbsp;
560    </p>
561    <h3 name="More">
562      &nbsp;
563    </h3>
nn698 
tt702      Note
703    </h3>
704    <p name="More">
705      For new line characters in a file use "\n" or "\r" this is 
 >OS dependent. I'm not exactly sure about this but I came across t
 >his function that's what led me to create this note.
706    </p>
707    <pre class="brush: js">
708    function getEol() { //eol means end of line, this returns the
 > get end of line character
709        var aPlatform = navigator.platform.toLowerCase();
710        if(aPlatform.indexOf('win') != -1) return "\r\n"; // win
711        else if(aPlatform.indexOf('mac') != -1) return "\r"; // m
 >ac
712        else return "\n";
713    }
714</pre>
715    <h3 name="More">

Back to History