Git Product home page Git Product logo

Comments (19)

noyouaretheman avatar noyouaretheman commented on July 18, 2024

I'm also having this issue, or at least experiencing something similar. I have some files on a remote directory, which I'm accessing from a Windows machine and a Linux machine.

With the same file open on both machines, changes on one machine don't show up on the other (e.g. I edit the file on Linux, but the changes don't show up in Atom on Windows). However, if I edit the file with an external editor, the changes will show up on the local machine; for example, editing the file with Vim on Linux makes the changes show up in Atom on Linux, and editing the file with Sublime on Windows makes the changes show up in Atom on Windows. The issue seems to be that changes done from a remote machine don't get caught on any local machines.

The desired behavior of remote edits showing up locally works in Sublime, so I suspect that it should be somehow possible in Atom. I might hack around with the code later and see if I can figure anything out.

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

I think this might be the same 'lack of notify' issue that affects files mounted via sshfs (#5). How are you sharing/mounting files between the host and guest, samba?

from file-watcher.

lgb3 avatar lgb3 commented on July 18, 2024

I think this might be the same 'lack of notify' issue that affects files mounted via sshfs (#5). How are you sharing/mounting files between the host and guest, samba?

Yes, I'm using Samba for that. I noticed that Atom properly reloads the file when it is changed from outside the editor, and the file lies in the same machine. So maybe this is a more generic problem?

But as "noyouaretheman" said, this works properly in Sublime.

I have a ticket opened in Atom's main repository:
atom/atom#12263 (comment)

from file-watcher.

noyouaretheman avatar noyouaretheman commented on July 18, 2024

I think this might be the same 'lack of notify' issue that affects files mounted via sshfs (#5). How are you sharing/mounting files between the host and guest, samba?

I'm using NFS. I wouldn't be surprised if this issue is related to #5.

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

Perhaps something like this can help you? I was considering a similar hacky solution to the mute mount problem. It's all very medieval.
https://github.com/rubyruy/watchntouch

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

Alternatively Samba 4.3 looks like it might have more support for change events:
https://wiki.samba.org/index.php/Samba_4.3_Features_added/changed#New_FileChangeNotify_subsystem

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

Ah! I might be able to put in a config option to switch to use fs.watchFile, if you know you are going to be using a mounted share. Let me look into that.

from file-watcher.

AlexisWalravens avatar AlexisWalravens commented on July 18, 2024

Hi, any update on this ? I recently switched form Sublime to Atom and that's the only feature I'm missing from Sublime. I only work on remote files on a local SMB server. (v4.3.11)

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

So after a lot of fighting with fs.watchFile and the current solution I was able to get this running for SSHFS. I should be pushing a new version tonight with this as an option.

from file-watcher.

noyouaretheman avatar noyouaretheman commented on July 18, 2024

from file-watcher.

AlexisWalravens avatar AlexisWalravens commented on July 18, 2024

Hi again,

  • When I edit a file from Sublime on the same computer where Atom is it works, it reloads the file correctly.
  • When I edit a file from the smb server directly on Ubuntu it works, it reloads the file correctly.
  • But, when the file is edited from another computer (connected to the SMB server), either on Sublime or Atom, I get the notification that the file has been edited but if i click "Reload", it does nothing, nor if I click on compare (it opens a new tab with the same file with no change).

Both computers are on macOS Sierra, and as I said before the SMB server is on v4.3.11.

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

@AlexisWalravens:

  • What does Sublime do in the 3rd scenario?
  • What do you see when you close and re-open the file?

What concerns me is the 'compare' option reads from the disk directly and should get the latest version that is available. I am wondering if something is happening with Samba and a delay, or some file system peculiarity that is not updating?

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

I'm going to reopen this temporarily.

from file-watcher.

AlexisWalravens avatar AlexisWalravens commented on July 18, 2024

@lwblackledge

  • Sublime does nothing more than Atom, the file is just edited from another computer than mine, and I tried both in Atom and Sublime to see if it had to do something with the editor the file is edited from.
  • If I close and then reopen the file in Atom (cmd + shift + t) the file is updated, that's usually what I do given that the plugin doesn't work for me.

Yep, I don't about the compare option, like I said if I click it it just open a new tab in a new pan with the same file without the changes.

Edit:
I made a video : https://cloudup.com/cPGQeFcyl5P

from file-watcher.

AnthonyWC avatar AnthonyWC commented on July 18, 2024

Reporting that it doesn't work even when 'use Watchfile' after atom reload (unless it requires reboot or unmount)

#apm -v
apm  1.15.3
npm  3.10.5
node 4.4.5 x64
python 2.7.12
git 2.7.4

#atom -v
Atom    : 1.15.0
Electron: 1.3.13
Chrome  : 52.0.2743.82
Node    : 6.5.0

#sshfs -V
SSHFS version 2.8
FUSE library version: 2.9.4
fusermount version: 2.9.4
using FUSE kernel interface version 7.19

from file-watcher.

AirAddicted avatar AirAddicted commented on July 18, 2024

Hi, this issue still exists so I'd like to provide you more info.

I'm using Atom on Windows and a SMB network drive. Whenever I change a file using external editor, Atom immediately shows that there are unsaved changes and the name of the file in an opened tab changes (from "file_name.txt - project_name" to "file_name.txt~"). When using WatchFile, sometimes notification appears but Compare and Reload just open a blank file. When using Reload the filename still is "file_name.txt~" which might be the reason why it doesn't work the same way as for local files

from file-watcher.

Edmundod avatar Edmundod commented on July 18, 2024

This issue also exists for me. I mount a directory from computational server by SSHFS and open file which contains numerical results. Every time my computation is done it adds a new results to the file. Unfortunately I don't see them in atom. Closing file and reopening works, but that's not a solution. My settings are:

  • Reload Auto: OFF
  • Prompt on Change: OFF
  • Include the Compare option: ON
  • Use WatchFile: ON

What's interesting, when "Prompt on Change" is ON, then everything works fine. But of course it's amazingly annoying, because file changes very frequently.
Another interesting thing, nano also doesn't show new lines even when I turn it off and on. But it shows from another terminal window. Vim and tail works ok.

from file-watcher.

danutchereches avatar danutchereches commented on July 18, 2024

Forget the 'lack of notify'. Why don't you check if the file was changed on focus? (like eclipse, gedit and many other apps)
And also, more importantly, on save.

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

New version should help - there have been some updates to Atom that I needed to accommodate

from file-watcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.