WSL doesn't update when Windows file system is updated


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?
windows windows-subsystem-for-linux
 |Â
show 1 more comment
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?
windows windows-subsystem-for-linux
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
 |Â
show 1 more comment
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?
windows windows-subsystem-for-linux
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
windows windows-subsystem-for-linux
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
 |Â
show 1 more comment
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
 |Â
show 1 more comment
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).
add a comment |Â
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).
add a comment |Â
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).
add a comment |Â
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).
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).
answered Apr 3 at 18:28
Rich Turner
1,471915
1,471915
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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