Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9284637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:57:16+00:00 2026-06-18T18:57:16+00:00

I am using this function to write text to a file via iMacros addon

  • 0

I am using this function to write text to a file via iMacros addon in FireFox.

//This function writes string into a file
function WriteFile(path,string)
{

//import FileUtils.jsm
Components.utils.import("resource://gre/modules/FileUtils.jsm");
//declare file
var file = new FileUtils.File(path);

//declare file path
file.initWithPath(path);

//if it exists move on if not create it
if (!file.exists())
{
file.create(file.NORMAL_FILE_TYPE, 0666);
}

var charset = 'EUC-JP';
var fileStream = Components.classes['@mozilla.org/network/file-output-stream;1']
.createInstance(Components.interfaces.nsIFileOutputStream);
fileStream.init(file, 18, 0x200, false);
var converterStream = Components
.classes['@mozilla.org/intl/converter-output-stream;1']
.createInstance(Components.interfaces.nsIConverterOutputStream);
converterStream.init(fileStream, charset, string.length,
Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);

//write file to location
converterStream.writeString("\r\n"+string);
converterStream.close();
fileStream.close();


}

But as for yesterday I started getting this message, regardless of which browser I tried and on different PC.

[Exception... "Component returned failure code: 0x80460003 (NS_ERROR_LOSS_OF_SIGNIFICANT_DATA) [nsIConverterOutputStream.writeString]"  nsresult: "0x80460003 (NS_ERROR_LOSS_OF_SIGNIFICANT_DATA)"  location: "JS frame :: chrome://imacros/content/iMacros.js :: WriteFile :: line 329"  data: no] (Error code: 991)

So I checked on mozilla developers what does this error mean and found this.

NS_ERROR_LOSS_OF_SIGNIFICANT_DATA (0x80460003)
NS_ERROR_ILLEGAL_DURING_SHUTDOWN (0x8046001E)
Many operations cannot be performed once the application is being shutdown. This error will occur in this situation.

But I can’t figure out what is the error here since I didn’t change the function code in any way. Can someone interpret this error ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T18:57:18+00:00Added an answer on June 18, 2026 at 6:57 pm

    I replaced this

    var charset = 'EUC-JP';
    

    with this

    var charset = 'UTF8';
    

    and it solved my problems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this function to read text lines from a file: string[] postFileLines =
I have this function which writes content to a text file: function write($text){ fwrite($this->fp,
I am using the following function to write a string to a File. The
I am using sink() function for printing R output to excel/text file. my program
Hi' i have permission denied when using write to text function like file_put_contents. i'm
The code I'm using to write a string to a file is as follows:
I'm trying to write text to a local file (i.e. on my laptop) using
I am using this function try to make a request to the server. I
I am using this function (that I found on this forum) to calculate the
I am using this function to list items from table helps depending on parameters:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.