WSL doesn't update when Windows file system is updated

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
-1
down vote

favorite












Here is my issue:



  • I edit a file on Windows, using a Windows file editor.

  • I save it to my Documents folder.

  • I try to compile the file on WSL using gcc.

  • If I saved the file as a new file, I can find it and work with it.

  • If I save the file without creating a new file (just using Ctrl+S), WSL doesn't notice the changes. cat file.c shows the old file, and there is no way to update it.

Is there any way to make WSL recognise that the file has been updated, and show the new version?










share|improve this question























  • I'm trying, but this question does not seem very clear to me. Are you saying that if you edit a file using a Windows program, and then try to look at that file with a WSL program, that the WSL program sees an older version of that same file?
    – Charles Green
    Mar 20 at 4:23










  • Yes exactly - I've updated the question so it's hopefully more clear.
    – Kunc
    Mar 20 at 4:34










  • Because this sounds like something Windows is doing wrong, I have to ask, have you tried restarting the computer?
    – wjandrea
    Mar 20 at 4:44










  • Yes absolutely - restarting both WSL and Windows. Doesn't seem to help, though even if it did this would be really inconvenient and I'd be surprised if it was expected behaviour.
    – Kunc
    Mar 20 at 4:46










  • Thanks for the edits - it is much clearer now. Is the Windows file editor closed at the point that you try to access the file with WSL? Could there be some odd delayed write behaviour?
    – Charles Green
    Mar 20 at 5:15














up vote
-1
down vote

favorite












Here is my issue:



  • I edit a file on Windows, using a Windows file editor.

  • I save it to my Documents folder.

  • I try to compile the file on WSL using gcc.

  • If I saved the file as a new file, I can find it and work with it.

  • If I save the file without creating a new file (just using Ctrl+S), WSL doesn't notice the changes. cat file.c shows the old file, and there is no way to update it.

Is there any way to make WSL recognise that the file has been updated, and show the new version?










share|improve this question























  • I'm trying, but this question does not seem very clear to me. Are you saying that if you edit a file using a Windows program, and then try to look at that file with a WSL program, that the WSL program sees an older version of that same file?
    – Charles Green
    Mar 20 at 4:23










  • Yes exactly - I've updated the question so it's hopefully more clear.
    – Kunc
    Mar 20 at 4:34










  • Because this sounds like something Windows is doing wrong, I have to ask, have you tried restarting the computer?
    – wjandrea
    Mar 20 at 4:44










  • Yes absolutely - restarting both WSL and Windows. Doesn't seem to help, though even if it did this would be really inconvenient and I'd be surprised if it was expected behaviour.
    – Kunc
    Mar 20 at 4:46










  • Thanks for the edits - it is much clearer now. Is the Windows file editor closed at the point that you try to access the file with WSL? Could there be some odd delayed write behaviour?
    – Charles Green
    Mar 20 at 5:15












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











Here is my issue:



  • I edit a file on Windows, using a Windows file editor.

  • I save it to my Documents folder.

  • I try to compile the file on WSL using gcc.

  • If I saved the file as a new file, I can find it and work with it.

  • If I save the file without creating a new file (just using Ctrl+S), WSL doesn't notice the changes. cat file.c shows the old file, and there is no way to update it.

Is there any way to make WSL recognise that the file has been updated, and show the new version?










share|improve this question















Here is my issue:



  • I edit a file on Windows, using a Windows file editor.

  • I save it to my Documents folder.

  • I try to compile the file on WSL using gcc.

  • If I saved the file as a new file, I can find it and work with it.

  • If I save the file without creating a new file (just using Ctrl+S), WSL doesn't notice the changes. cat file.c shows the old file, and there is no way to update it.

Is there any way to make WSL recognise that the file has been updated, and show the new version?







windows windows-subsystem-for-linux






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 20 at 4:42









wjandrea

7,19342255




7,19342255










asked Mar 20 at 3:51









Kunc

12




12











  • I'm trying, but this question does not seem very clear to me. Are you saying that if you edit a file using a Windows program, and then try to look at that file with a WSL program, that the WSL program sees an older version of that same file?
    – Charles Green
    Mar 20 at 4:23










  • Yes exactly - I've updated the question so it's hopefully more clear.
    – Kunc
    Mar 20 at 4:34










  • Because this sounds like something Windows is doing wrong, I have to ask, have you tried restarting the computer?
    – wjandrea
    Mar 20 at 4:44










  • Yes absolutely - restarting both WSL and Windows. Doesn't seem to help, though even if it did this would be really inconvenient and I'd be surprised if it was expected behaviour.
    – Kunc
    Mar 20 at 4:46










  • Thanks for the edits - it is much clearer now. Is the Windows file editor closed at the point that you try to access the file with WSL? Could there be some odd delayed write behaviour?
    – Charles Green
    Mar 20 at 5:15
















  • I'm trying, but this question does not seem very clear to me. Are you saying that if you edit a file using a Windows program, and then try to look at that file with a WSL program, that the WSL program sees an older version of that same file?
    – Charles Green
    Mar 20 at 4:23










  • Yes exactly - I've updated the question so it's hopefully more clear.
    – Kunc
    Mar 20 at 4:34










  • Because this sounds like something Windows is doing wrong, I have to ask, have you tried restarting the computer?
    – wjandrea
    Mar 20 at 4:44










  • Yes absolutely - restarting both WSL and Windows. Doesn't seem to help, though even if it did this would be really inconvenient and I'd be surprised if it was expected behaviour.
    – Kunc
    Mar 20 at 4:46










  • Thanks for the edits - it is much clearer now. Is the Windows file editor closed at the point that you try to access the file with WSL? Could there be some odd delayed write behaviour?
    – Charles Green
    Mar 20 at 5:15















I'm trying, but this question does not seem very clear to me. Are you saying that if you edit a file using a Windows program, and then try to look at that file with a WSL program, that the WSL program sees an older version of that same file?
– Charles Green
Mar 20 at 4:23




I'm trying, but this question does not seem very clear to me. Are you saying that if you edit a file using a Windows program, and then try to look at that file with a WSL program, that the WSL program sees an older version of that same file?
– Charles Green
Mar 20 at 4:23












Yes exactly - I've updated the question so it's hopefully more clear.
– Kunc
Mar 20 at 4:34




Yes exactly - I've updated the question so it's hopefully more clear.
– Kunc
Mar 20 at 4:34












Because this sounds like something Windows is doing wrong, I have to ask, have you tried restarting the computer?
– wjandrea
Mar 20 at 4:44




Because this sounds like something Windows is doing wrong, I have to ask, have you tried restarting the computer?
– wjandrea
Mar 20 at 4:44












Yes absolutely - restarting both WSL and Windows. Doesn't seem to help, though even if it did this would be really inconvenient and I'd be surprised if it was expected behaviour.
– Kunc
Mar 20 at 4:46




Yes absolutely - restarting both WSL and Windows. Doesn't seem to help, though even if it did this would be really inconvenient and I'd be surprised if it was expected behaviour.
– Kunc
Mar 20 at 4:46












Thanks for the edits - it is much clearer now. Is the Windows file editor closed at the point that you try to access the file with WSL? Could there be some odd delayed write behaviour?
– Charles Green
Mar 20 at 5:15




Thanks for the edits - it is much clearer now. Is the Windows file editor closed at the point that you try to access the file with WSL? Could there be some odd delayed write behaviour?
– Charles Green
Mar 20 at 5:15










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Assuming you're running Windows 10 Creators Update or later, WSL does support File Change Notifications via iNotify, so if you open & edit a file in gedit, VSCode, Sublime, Notepad, Notepad++, etc. and hit save, the file will be updated and WSL should receive the inotify file change notification.




Note: If you repeatedly hit CTRL+S in some editors, they won't write to the file until the editor's contents have changed. Try inserting and deleting a space (to fool the editor into thinking its contents have changed) and re-saving afterwards.




Alternatively, try another editor (e.g. one listed above).






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1017496%2fwsl-doesnt-update-when-windows-file-system-is-updated%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Assuming you're running Windows 10 Creators Update or later, WSL does support File Change Notifications via iNotify, so if you open & edit a file in gedit, VSCode, Sublime, Notepad, Notepad++, etc. and hit save, the file will be updated and WSL should receive the inotify file change notification.




    Note: If you repeatedly hit CTRL+S in some editors, they won't write to the file until the editor's contents have changed. Try inserting and deleting a space (to fool the editor into thinking its contents have changed) and re-saving afterwards.




    Alternatively, try another editor (e.g. one listed above).






    share|improve this answer
























      up vote
      0
      down vote













      Assuming you're running Windows 10 Creators Update or later, WSL does support File Change Notifications via iNotify, so if you open & edit a file in gedit, VSCode, Sublime, Notepad, Notepad++, etc. and hit save, the file will be updated and WSL should receive the inotify file change notification.




      Note: If you repeatedly hit CTRL+S in some editors, they won't write to the file until the editor's contents have changed. Try inserting and deleting a space (to fool the editor into thinking its contents have changed) and re-saving afterwards.




      Alternatively, try another editor (e.g. one listed above).






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        Assuming you're running Windows 10 Creators Update or later, WSL does support File Change Notifications via iNotify, so if you open & edit a file in gedit, VSCode, Sublime, Notepad, Notepad++, etc. and hit save, the file will be updated and WSL should receive the inotify file change notification.




        Note: If you repeatedly hit CTRL+S in some editors, they won't write to the file until the editor's contents have changed. Try inserting and deleting a space (to fool the editor into thinking its contents have changed) and re-saving afterwards.




        Alternatively, try another editor (e.g. one listed above).






        share|improve this answer












        Assuming you're running Windows 10 Creators Update or later, WSL does support File Change Notifications via iNotify, so if you open & edit a file in gedit, VSCode, Sublime, Notepad, Notepad++, etc. and hit save, the file will be updated and WSL should receive the inotify file change notification.




        Note: If you repeatedly hit CTRL+S in some editors, they won't write to the file until the editor's contents have changed. Try inserting and deleting a space (to fool the editor into thinking its contents have changed) and re-saving afterwards.




        Alternatively, try another editor (e.g. one listed above).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 3 at 18:28









        Rich Turner

        1,471915




        1,471915



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1017496%2fwsl-doesnt-update-when-windows-file-system-is-updated%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            GRUB: Fatal! inconsistent data read from (0x84) 0+xxxxxx

            Problem in reading from socket

            Do not install recommended packages of dependencies