aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: amule pre-release: Tree Structure bug - can't expand 'Volumes'  (Read 5063 times)

Gadsden

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
amule pre-release: Tree Structure bug - can't expand 'Volumes'
« on: November 21, 2004, 06:09:26 PM »

The implication of this is that one cannot share files on external drives.

Preferenecs -> Directories -> Shared Directories field.

Expand "/"
inside which is "volumes"

---- It is not possible to expand volumes -----

I definitely have an External mounted:

Terminal:

$ ls /Volumes
ExternalFirewire120     Macintosh HD            ircle 3.1 British


This bug was reported on the IRC channel.

Thanks to Kry for developing this prerelease. I have an amule that works!!!   :baby:
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
RE: amule pre-release: Tree Structure bug - can't expand 'Volumes'
« Reply #1 on: November 23, 2004, 03:33:52 AM »

Gadsden and I worked out a workaround for this bug while Kry selfishly hoards his fix.   X( 8)

The tree structure won't expand a directory unless it has subdirectories.  This is normal, because what would it show under such an expanded directory?

For some reason, the items within /Volumes don't count.  Being volumes, I'm sure they're special in some nonobvious way.  So, the tree control won't expand /Volumes.

We tried directly editing ~/.aMule/shareddir.dat to include /Volumes/volumename/path/to/share/, but that didn't seem to work.  Still no idea why.  This may indicate that even if the tree control would expand /Volumes that sharing from there wouldn't work for some other reason.  Or, it may mean that I don't properly understand the role of shareddir.dat.

Finally, we got symlinks to succeed.  In a directory of your choice, so long as it has a real subdirectory (even an empty one), create a symlink to the volume which contains files you'd like to share.  (If you'd prefer, you can symlink just the directory that you'd like to share from the volume.)  So, if your second volume is named "Fred", you could do this in Terminal:
Code: [Select]
# Work in your home directory.
cd ~

# Create a directory to contain symlinks to your other volumes.  Name this whatever you like.
mkdir MyVolumes
# Work in the new directory
cd MyVolumes

# Create a real subdirectory so that the tree control will let you expand MyVolumes.
# Again, name as you like.
mkdir DummyEmptyDir

# Create the symlink to your other volume
ln -s /Volumes/Fred Fred
The last command ("ln") is the one which creates the symlink.  The other commands just set up a convenient directory to contain it and which satisfies the tree control's requirement that there be a real subdirectory.  If you already have a directory you'd rather use (maybe ~/.aMule), just "cd" to it and issue the "ln" command there.

Now, in aMule Preferences : Directories : Shared Directories, you can navigate to /Users/username/MyVolumes/Fred and its subdirectories.  Double-click a directory to share that directory's immediate contents; control-click a directory to share it and all its subdirectories.
Logged

Jacobo221

  • Hero Member
  • *****
  • Karma: 3
  • Offline Offline
  • Posts: 2712
Re: amule pre-release: Tree Structure bug - can't expand 'Volumes'
« Reply #2 on: November 23, 2004, 12:56:44 PM »

Wow, good trick-tip there
I guess the problem comes from wxWidgets. so either kry gets to know about what's up with wxwidgets or a walkaround must be done within aMule to avoid this problem (like checking when someone tries to access /volumes and directly create this links etc...)
Good one :)
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: amule pre-release: Tree Structure bug - can't expand 'Volumes'
« Reply #3 on: November 25, 2004, 11:21:20 PM »

OK, shortly after posting the workaround above, I had a forehead-slapping "Duh!" realization.  (I haven't had internet access to share it until now.)

I'm now guessing that direct editing of shareddir.dat will in fact work.  I haven't had a chance to verify because I don't have an external volume to test with.  Gadsden or somebody will have to test what I'm about to say to make sure.

While Gadsden and I were working through the problem and coming up with the workaround, we went through a process.  After protracted efforts to make shareddir.dat work, we finally concluded that it couldn't be made to work.  Unfortunately, when new information came to light, I failed to revisit that conclusion and realize it was wrong.

Here's what happened.  I had one piece of knowledge and Gadsden had another.  It wasn't until after we dismissed shareddir.dat that we put them together.  I knew that when you share a directory, you only share the files immediately inside that directory.  aMule doesn't traverse subdirectories and share the files within unless you explicitly share the subdirectories, too.  Gadsden knew that the directory he was trying to share didn't contain any files, only subdirectories, and those contained files.

So, we never tried the shareddir.dat technique with a directory that actually contained files.  Doh!

So, to sum up, it is probable that if you edit shareddir.dat to contain /Volume/volumename/path/to/shared/dir/ paths, that aMule will properly share the files within the named directories.  If you have a whole hierarchy of directories that you want to share, you have to add each subdirectory explicitly.  The format of shareddir.dat is one path per line.  Include the trailing slash ("/") on the path, because that's what aMule does when it edits that file.

Now, the symlink technique does work and has the advantage that you can use the GUI to browse the hierarchy.  Also, the GUI has the control-click shortcut for adding a directory and all its subdirectories to the shared set at once.  And it's less error prone (no typos, e.g.).

So, now there are two workarounds.  Also, there's every reason to believe that fixing the tree control to properly expand /Volumes will in fact solve the problem.

If anybody with an external drive wants to test this, please let us know what you find.
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: amule pre-release: Tree Structure bug - can't expand 'Volumes'
« Reply #4 on: December 08, 2004, 03:48:29 AM »

No more need for dirty tricks yo kiddies. Just use lastest cvs ;)
Logged