zlatinb / muwire

MuWire file sharing client for I2P
GNU General Public License v3.0
193 stars 27 forks source link

Windows: Can't rename shared subfolders? #95

Open Searinox opened 3 years ago

Searinox commented 3 years ago

Folders that are being shared, even deep within the root shared folder, cannot be renamed. The system reports that they're in use and I have to close MuWire before I'm able to do it. This is despite MuWire in general being able to recognize modified or deleted files or folders and update its share accordingly. Can anything be done about this?

zlatinb commented 3 years ago

The reason this happens is because the folders are being "watched" for changes. Watching can be done in two ways - automatic or manual. The default type is automatic, and that involves registering the folder being watched with an operating system watch service - which is why Windows reports the folder as being in use. This is what the "Auto" checkbox means in the "Watched Directories" panel.

There is no real solution to this, but there are few ways around it:

  1. The cleanest approach is to exit MuWire, rename the folder and start it again. This will re-share the files in the folder and get all hidden and visible roots updated accordingly.
  2. The second approach is to just unshare the folder, rename it, then share it again without quitting MuWire. This has a side effect that an entry will be made into the "negative tree" with the old folder name. This is quite harmless.
  3. The least recommended approach, and it might even not work, is to switch to manual watching of the folder, then try to rename. I have never tried this and it may break things.

I think the most reasonable thing I can do is to add a global setting whether to watch folders automatically by default.