Windows 10: Windows 10 JScript Text File Open/Close -- File not really closed!

Discus and support Windows 10 JScript Text File Open/Close -- File not really closed! in Windows 10 BSOD Crashes and Debugging to solve the problem; This is a flaw in Win-10. Explanation follows. I write a lot of programs in JScript. (This has nothing to do with web development, I'm using JScript... Discussion in 'Windows 10 BSOD Crashes and Debugging' started by Judd.Jones, Mar 23, 2019.

  1. Windows 10 JScript Text File Open/Close -- File not really closed!


    This is a flaw in Win-10. Explanation follows.


    I write a lot of programs in JScript. (This has nothing to do with web development, I'm using JScript as a scripting language.)


    I have a certain function I use a lot, called "log( )". You give it a string, and it copies the string to the command window, and to a log file. It's simple. In outline, it looks like this:


    function log( message )
    { WScript.Echo( message );
    LL = fsWindows 10 JScript Text File Open/Close -- File not really closed! o_OpenTextFile( LOGFILE, 8, true); //8=appending, true=create if needed
    LL.WriteLine( message );
    LL.Close();
    }

    I left out a few details for clarity, like some error checking, and fso = new ActiveXObject("Scripting.FileSystemObject"); To avoid any chance of collision, this function creates it's own fso, every time you call it.


    When I started to use this function on Win-10, it FAILED ALL THE TIME! How can it fail, you ask? It's been working fine on Win-EverythingElse for the last 12+ years.


    Well, for starters, I very often use it like this:


    log("ANZIncremental = " + ANZIncremental );

    log("ANZInvariant = " + ANZInvariant );

    log("ANZCycleBased = " + ANZCycleBased );

    log("ANZTraditional = " + ANZTraditional );

    log("DDGIncremental = " + DDGIncremental );

    log("DDGInvariant = " + DDGInvariant );

    log("DDGCycleBased = " + DDGCycleBased );

    log("DDGTraditional = " + DDGTraditional );


    That is to say, one rapid-fire log( ) statement after another. So it's trying to open, close, and then re-open the same file in rapid succession.


    It was failing on LL = fsWindows 10 JScript Text File Open/Close -- File not really closed! o_OpenTextFile( ). So my hypothesis was, "What if the LL.Close( ) method doesn't really close the file? What if it's still open when you call OpenTextFile( ) the next time?"


    Sure enough, I fixed it like this. Again, I've left out some details for clarity.


    function log(message)
    { WScript.Echo( message );

    success = false;

    while( !success ){
    try {
    LL = fsWindows 10 JScript Text File Open/Close -- File not really closed! o_OpenTextFile( LOGFILE, 8, true); //8=appending, true=create if needed

    success = true;
    } //try
    catch(e){
    success = false; //and do something sensible
    WScript.Sleep(1);
    } //catch(e)

    LL.WriteLine( message );

    LL.Close();
    } //while( !success )
    } //function log( )


    Via this and various other tests, I was able to convince myself that my hypothesis was correct. LL.Close( ) doesn't really close the file.


    I think this is a flaw in the operating system. When you call a close( ) function, the file should be well and truly closed before it gives control back to the caller.


    What sayest thou?

    :)
     
    Judd.Jones, Mar 23, 2019
    #1
  2. Ahhzz Win User

    Windows 10 Tweaks

    Pressing “Windows+Pause Break” (it’s up there next to scroll lock) opens the “System” Window.

    Windows 10: In the new version of Windows, Explorer has a section called Quick Access. This includes your frequent folders and recent files. Explorer defaults to opening this page when you open a new window. If you’d rather open the usual This PC, with links to your drives and library folders, follow these steps:

    • Open a new Explorer window.
    • Click View in the ribbon.
    • Click Options.
    • Under General, next to “Open File Explorer to:” choose “This PC.”
    • Click OK


    credit to Lifehacker.
     
    Ahhzz, Mar 23, 2019
    #2
  3. Ketxxx Win User
    opening .dds files with gimp

    Simply, HOW? I got the DDS plugin but the POS wont open DDS files still. Can someone give me a step-by-step rundown of how to install the DDS plugin for gimp so I know if I'm missing something?
     
    Ketxxx, Mar 23, 2019
    #3
  4. Windows 10 JScript Text File Open/Close -- File not really closed!

    Corrupted file RAR

    If the archive has been created using WinRAR, why don't you try WinRAR itself? It has a built-in repair feature for repairing corrupted archive (ZIP as well as RAR). Follow the steps given below:
    • Open WinRAR application in your system.
    • Now click on File tab > Open or simply press Ctrl+O.
    • A small window "Find Archive" will pop up. Locate the corrupt RAR archive from your system directory and select it.
    • Now click Open button.
    • Click Tools tab > Repair archive or simply press Alt+R.
    • Again a small window "Repairing File name.rar" will pop up.
    • Now click Browse to select a location to save the repaired archive.
    • Check the box "Treat the corrupt archive as RAR" and click OK.
    • WinRAR will start repairing of corrupt RAR archive. Once it gets completed click Close.
    I hope the above steps will help you repair the corrupted RAR archive.

    Thanks.
     
    Lincoln Dunne, Mar 23, 2019
    #4
Thema:

Windows 10 JScript Text File Open/Close -- File not really closed!

Loading...
  1. Windows 10 JScript Text File Open/Close -- File not really closed! - Similar Threads - JScript Text File

  2. How to close open files

    in Windows 10 Network and Sharing
    How to close open files: I am trying to delete a folder and it says either its openwhich its not or one of the files are in use. how do i find what's using it and close it https://answers.microsoft.com/en-us/windows/forum/all/how-to-close-open-files/5a59dd35-5fc5-424f-bf23-5aff2497dfd6
  3. How to close open files

    in Windows 10 Gaming
    How to close open files: I am trying to delete a folder and it says either its openwhich its not or one of the files are in use. how do i find what's using it and close it https://answers.microsoft.com/en-us/windows/forum/all/how-to-close-open-files/5a59dd35-5fc5-424f-bf23-5aff2497dfd6
  4. How to close open files

    in Windows 10 Software and Apps
    How to close open files: I am trying to delete a folder and it says either its openwhich its not or one of the files are in use. how do i find what's using it and close it https://answers.microsoft.com/en-us/windows/forum/all/how-to-close-open-files/5a59dd35-5fc5-424f-bf23-5aff2497dfd6
  5. Open File and Close Explorer

    in Windows 10 Gaming
    Open File and Close Explorer: Is there something like a context menu option to open a selected file and close File Explorer Windows Explorer at the same time? Sometimes I know that I have no further need for Explorer after selecting a file.Thanks!...
  6. Open File and Close Explorer

    in Windows 10 Software and Apps
    Open File and Close Explorer: Is there something like a context menu option to open a selected file and close File Explorer Windows Explorer at the same time? Sometimes I know that I have no further need for Explorer after selecting a file.Thanks!...
  7. game is keep closing in full windows, random file or program opening and closing really fast

    in Windows 10 Ask Insider
    game is keep closing in full windows, random file or program opening and closing really fast: hey guys, there is this random program that opens and closes really fast cant tell what is it. when ever i play games it gets minimized, if i put it on windowed borderles instead of minimizing it, shows the task bar for a split second then back to the game. no this does...
  8. Windows 10 - File Explorer file opening and closing

    in Windows 10 Network and Sharing
    Windows 10 - File Explorer file opening and closing: When I open a file in File Explorer and then close it, after the close File Explorer does not return to File Explorer, but to some other app I have open. How can I set this to return to FE upon file close....
  9. Closing open Files

    in Windows 10 Network and Sharing
    Closing open Files: I have been a Works 4.5 user for many years. Because of problems with new Canon Printer I was advised to upgrade to Works 9. It is loaded. I have been working with it simi-succesfully. But now when I click Task Launcher and chose the database program I get a message that I...
  10. WHEN OPENING A FILE FOLDER AND CLOSING IT

    in Windows 10 Network and Sharing
    WHEN OPENING A FILE FOLDER AND CLOSING IT: WHEN I OPEN A FILE FOLDER AND THEN SUCCESSIVE FOLDERS CONTAINED WITHIN THE FIRST ONE I FIND THAT IN ORDER TO CLOSE OUT I MUST CLOSE MULTIPLE FOLDERS. I WANT TO MAKE IT SO THAT I CAN CLOSE ONE FOLDER AND BE DONE WITH IT. I AM SEARCHING FOR A SETTING TO FIX THIS ISSUE....

Users found this page by searching for:

  1. how to open a jscript file windows

    ,
  2. jscript text file