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

  • Home
  • SEARCH
  • 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 4246088
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:55:37+00:00 2026-05-21T03:55:37+00:00

I have code to copy a file to a new location, then open the

  • 0

I have code to copy a file to a new location, then open the file at this new location. As far as I can tell, there is a problem that the code may try to open the file before the copy has been completed.

This problem is specific to a Firefox extension which is copying an sqlite database from a default location to a new location specified by the user. If the sqlite file doesn’t exist in the new location, then the call to openDatabase will create a new, blank database.

// some pseudocode
var old_path // is an nsILocalFile instance
var new_path // is an nsILocalFile instance

// copy file
old_path.copyTo(new_path)

// open sqlite database
var ss = Components.classes["@mozilla.org/storage/service;1"]
         .getService(Components.interfaces.mozIStorageService);
var db = ss.openDatabase(new_path)

How can I wait for the copy to be completed? (Events, event listeners, observers…?)

  • 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-05-21T03:55:38+00:00Added an answer on May 21, 2026 at 3:55 am

    Neil’s comment to my question prompted me to check my code and I think I have found a bug which caused the sqlite file to be overwritten by mistake.

    Closing question.

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

Sidebar

Related Questions

I have the code to copy a file to another location. public static void
Does anyone have sample code to copy open (in-use and locked by another program)
I have code like this: var newMsg = new Msg { Var1 = var1,
Does anybody have a sample code on how i could open a tif file,
I have the following code to open Excel template file and save it as
I have a code , but I do not how can I find copy
I have two code bases of an application. I need to copy all the
I have code that references a web service, and I'd like the address of
I have code similar to this filtering entries in an Array of Objects: var
I have code like this: template <typename T, typename U> struct MyStruct { T

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.