aMule Forum
English => Multiplatform => Mac OSX => Topic started by: eisa01 on January 08, 2008, 09:51:01 PM
-
Here's a new SVN compile for those of you who have PPC macs like me. It's from February 26th, and compiled against wxMac 2.8.7. Works on Leopard, don't know about Tiger.
http://rapidshare.de/files/38695888/aMule.zip.html
-
On Tiger:
xxx:~/Desktop/aMule Folder/aMule.app/Contents/MacOS kreegee$ ./amule
dyld: Library not loaded: /usr/local/lib/libpng.3.dylib
Referenced from: /Users/xxx/Desktop/aMule Folder/aMule.app/Contents/MacOS/amule
Reason: image not found
Trace/BPT trap
-
Seems like you need to have libpng installed.
Get the sources and compile it yourself: http://www.libpng.org/pub/png/libpng.html
Or get it through MacPorts: http://www.macports.org/
-
FYI : http://forum.amule.org/index.php?topic=14342.msg76466#msg76466
-
I wouldn't be surprised if the reason it won't work for you is that you are on Panther, and I've compiled it on Leopard. There's 4 years between the release dates of those two OSes.
-
It's simple to include a library needed by amule in the bundle. Simply:
With Terminal move in to the aMule.app/Content/MacOS dir.
Execute the command "otool -L amule" to see wich library are used by the app. Some are the wx, and is already present in the framework dir, and present a path like "@executable_path/../Frameworks/libname", some other are system wide library, present in all mac, like the varius libstd and the libsystem.
For each library you have compiled yourself in order to have aMule run do this procedure, but first notice this thigs:
If you look, for example, for libz.1.dylib, wich is reported by otool, being in /usr/lib/libz.1.dylib, you will notice this is a simbolic link for a file in the same dir called libz.1.2.3.dylib. THIS is the real library.
1 - move the REAL library in the Framework dir, and rename it as the one reported by otool, so in example, otool report /usr/lib/libz.1.dylib, then you must move the /usr/lib/libz.1.2.3.dylib in Framework, and rename it to libz.1.dylib.
2 - execute install_name_tool -id @executable_path/../Frameworks/$LIBPATH Frameworks/$LIBPATH (of cource change $LIBPATH with the FULL lib path reported by otool)
3 - install_name_tool -change $LIBPATH @executable_path/../Frameworks/$LIBPATH amule
4 - Execute the otool on the library you have imported and fix the dependecies repeating all the stept.
So in exmple, soppose amule depend on libA.1.dylib, you have to locate the real libA, move to Framework dir in aMule.app, execute the step 2 and 3, execute otool -L libA.1.dylib and look for other libs you have compiled in order to build libA. In the 99,9999% of the case there is no dependencies at this level, but check will not hurt!
If i was't so much clear, please refer to the mac_packager script, this is a bash script doing the same things, but restricted to wx libs. If you understand bash script this is more clear than my words! :P
-
OK, it didn't include libpng, so I think I've fixed that now. Could anyone check if it works now?
http://rapidshare.de/files/38684307/aMule.zip.html
-
You mean you DID include libpng. :P
I'm on Tiger, so i can't try it. But looking at otool -L it seems you have do a good yob!
-
Did a newcompile today, hope it works!
http://rapidshare.de/files/38685518/aMule.zip.html
-
I tink you should modify the thread title and include your MacOS X version.
Regarding the relase, you do a great job! I can't test it, hope someone like Jose Hidalgo will try as soon as possible!
Could you please post a version of amulegui? I don't knows if in the daily tarball is already committed a little change that the user bongo have submitted. I forward you to this post:
http://forum.amule.org/index.php?topic=14342.msg76569#msg76569
and the subsequent for istruction on how to do. The procedure is simple, if you have some problem ask and i will help as much as i can! 8)
-
Sorry, I didn't build it with the remote GUI.
-
Did a newcompile today, hope it works!
http://rapidshare.de/files/38685518/aMule.zip.html
Bummer...
I'm running an iMac G5 with the latest version of Leopard. Sad to report that this build of aMule fails to run. As soon as it is launched, it quits unexpectedly.
According to the Apple Crash Report, libpng wasn't found.
Dyld Error Message:
Library not loaded: ../Frameworks/libpng.3.1.2.8.dylib
Referenced from: /Applications/aMule/aMule.app/Contents/MacOS/amule
Reason: image not found
Would it help to identify the problem if I posted the entire crash log?
Thanks for your effort, in any event!
Best,
TBNTX
-
OK, think I wrote the library name wrong. Try this version: http://rapidshare.de/files/38695888/aMule.zip.html
-
OK, think I wrote the library name wrong. Try this version: http://rapidshare.de/files/38695888/aMule.zip.html
Okay, this version works when launched. There were some notable bugs I've observed, but they may be unique to me.
- I use a network drive under the official "Tiger" version. When I launched this SVN build, it didn't recognize the path even though the network volume was mounted on my desktop and it went to the default directories on my startup drive.
- Once I changed the default "Incoming" and "Temp" directories in the settings. I had to restart (which is normal when you change the Temp directory), but then it had to rehash all of the files.
- Several files that were in the process of downloading using the "Tiger" release couldn't be updated or finished (permissions issue)
- There is a display rendering problem if you go to PREFERENCE>EVENTS, and you click on an item in the list (e.g., "Error on Completion")
- If you select PREFERENCE>DIRECTORIES and expand the "Shared Directories" list, try scrolling down to the "Volumes" directory. In the "Tiger" version, there is an "expose detail" arrow preceding it. It is absent in the SVN build. If I wanted to share a directory on another drive (including a network volume mounted on the desktop), you cannot do so.
- If you use the SVN version, you cannot go back to the official released builds (at least I wasn't able to do so).
Please don't consider this a list 'o' gripes, Eisa01. I'm just wanted to post my experience so that others who may be considering using your SVN build can make an informed decision. I genuinely appreciate that you've built the SVN version for Leopard users, and you have my gratitude.
Best,
TBNTX
-
I use a network drive under the official "Tiger" version. When I launched this SVN build, it didn't recognize the path even though the network volume was mounted on my desktop and it went to the default directories on my startup drive.
This is not a problem not of amule, but one of Wx, to find your Network Disk, you must go in /Volumes directory.
Once I changed the default "Incoming" and "Temp" directories in the settings. I had to restart (which is normal when you change the Temp directory), but then it had to rehash all of the files.
It's normal. I think... :P
Several files that were in the process of downloading using the "Tiger" release couldn't be updated or finished (permissions issue)
The propblem of permission is strange... Where did you see that ther's a permission problem? From the log? Can you please post the portion of log? It may be useful for dev.
- There is a display rendering problem if you go to PREFERENCE>EVENTS, and you click on an item in the list (e.g., "Error on Completion")
- If you select PREFERENCE>DIRECTORIES and expand the "Shared Directories" list, try scrolling down to the "Volumes" directory. In the "Tiger" version, there is an "expose detail" arrow preceding it. It is absent in the SVN build. If I wanted to share a directory on another drive (including a network volume mounted on the desktop), you cannot do so.
For these i will pass! :-[
If you use the SVN version, you cannot go back to the official released builds (at least I wasn't able to do so).
Strange, but quite reasonable, if you think that devs wirite changes to the code every day. Start a new download with an SVN mean yo will use a bunch of new techniques that "Tiger" version doesn't know!
-
Nice that it worked for you!
About sharing network drives, I have the same problem with external drives, I've reported it in the bug tracker here: http://bugs.amule.org/view.php?id=1203
The layout bug is also reported: http://bugs.amule.org/view.php?id=1082
I've bumped the bugs, so hopefully a dev will notice it.
-
This still hasn't been solved by a miracle? :( It worked for our misterious preferences crash on Windows...
Well...unfortunately we have still no active Mac developers, so I can't promise anything. But I'll try to write some test code (please remind me via PM if I don't) about the network files issue. Please be aware that I don't know how an external drive on a Mac looks like, but my code should be generic enough.
-
- There is a display rendering problem if you go to PREFERENCE>EVENTS, and you click on an item in the list (e.g., "Error on Completion")
This bug is also present in the MSW version, and will be fixed soon.
-
Please be aware that I don't know how an external drive on a Mac looks like, but my code should be generic enough.
Tnks a lot, wuischke. On mac network share are of two type. SMB, via normal samba share of AFP, wich is "the apple version of samba".
Consider the Volumes forlder of a mac, like the /mnt or /media folders on linux. In that folder the automount daemon is mountig the network disk and the external drive, such usb disk o pen.
-
OK, please try my simple test program. (See the file compile for the command to compile it.)
The file dialog is a wx function, this should work and you should be able to select a file on your external volume.
Then It'll use an aMule function to create a backup of the file, this is the interesting part.
-
I've tested, it's working right! the file is created and the copy have the original md5sum of the original. (maybe this is usless, but... :-p)
-
Doesn't seem to work here, I only get to change one field. Clicking anywhere else does not affect anything. I'll attach a picture with the only field I'm allowed to do anything with.
PPC Leopard btw
-
This is because you can't run ANY app that use a Greaphical user interface without put it in a bundle.
I take the amule.app present in a new unpacked tarball, and put the testfile executable in it, inside Contents/MacOS and changed the name from testfile to amule. This will make it work properly.
-
Ah, then it worked :)
-
OK, let's go on with our tests: Now we'll select a directory and use the aMule function (which is a direct call to the wx function) to list all subdirectories.
Please try it with the directory aMule won't list.
-
It's missing the foldertest.cpp file, and problably the header file if you had one of those too.
-
Sorry, I've updated the file.
-
Works fine, I can select folders on external volumes and it displays the subfolders in the dialog.
-
Good, i haven't tried it yet, but this is a good new!
-
- There is a display rendering problem if you go to PREFERENCE>EVENTS, and you click on an item in the list (e.g., "Error on Completion")
I fixed it in MSW. Could you please test whether it fixed the Mac problem, too?
-
Works fine, I can select folders on external volumes and it displays the subfolders in the dialog.
No, it doesn't work:
Yes, if I select an external disk/partition then it lists correctly the content,
but if I choose /Volumes then it doesn't list the content:
at least it doesn't list active mount points, if I create an empty dir it lists only it...
It seems to stay in local filesystem and don't see mount points.
I compiled foldertest so:
`../wxMac-2.8.8/osx-build/wx-config --cxx` `../wxMac-2.8.8/osx-build/wx-config --cxxflags` `../wxMac-2.8.8/osx-build/wx-config --libs` foldertest.cpp Path.cpp StringFunctions.cpp FileFunctions.cpp -o foldertest
I know this is an old and OT thread, but I considered it important to resume this test,
since the issue is still open...
If someone can split this topic...
EDIT:
Mmm from graphics they seem alias (see last image),
but from shell they seem directory/mountpoints:
super:~ gtoso$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s3 19G 17G 1.8G 90% /
devfs 114K 114K 0B 100% /dev
fdesc 1.0K 1.0K 0B 100% /dev
<volfs> 512K 512K 0B 100% /.vol
/dev/disk0s5 9.9G 9.8G 93M 99% /Volumes/OSXServer
/dev/disk0s6 8.8G 4.7G 4.1G 54% /Volumes/Leopard
/dev/disk0s8 37G 36G 1.0G 97% /Volumes/Extras
automount -nsl [127] 0B 0B 0B 100% /Network
automount -fstab [132] 0B 0B 0B 100% /automount/Servers
automount -static [132] 0B 0B 0B 100% /automount/static
/dev/disk1s2 91G 66G 25G 73% /Volumes/Mastro
super:~ gtoso$ ls -la /Volumes/
total 24
drwxrwxrwt 9 root admin 306 Sep 8 16:37 .
drwxrwxr-t 30 root admin 1122 Sep 8 10:56 ..
-rw-rw-rw- 1 administ admin 6148 Sep 2 19:21 .DS_Store
drwxrwxr-t 12 root admin 510 Mar 14 12:38 Extras
drwxrwxr-t 9 root admin 408 Aug 16 19:16 Leopard
drwxr-xr-x 9 gtoso gtoso 408 Aug 18 18:48 Mastro
lrwxr-xr-x 1 root admin 1 Sep 3 13:44 OSX -> /
drwxrwxr-t 34 root admin 1258 Feb 18 2007 OSXServer
drwxr-xr-x 2 gtoso admin 68 Sep 8 16:37 pippo
super:~ gtoso$ /Developer/Tools/GetFileInfo /Volumes/Mastro
directory: "/Volumes/Mastro"
attributes: avbstclinmedz
created: 08/18/2008 18:25:36
modified: 08/18/2008 18:48:50
super:~ gtoso$ /Developer/Tools/GetFileInfo /Volumes/pippo
directory: "/Volumes/pippo"
attributes: avbstclinmedz
created: 09/08/2008 16:37:36
modified: 09/08/2008 16:37:36
super:~ gtoso$ mount
/dev/disk0s3 on / (local, journaled)
devfs on /dev (local)
fdesc on /dev (union)
<volfs> on /.vol
/dev/disk0s5 on /Volumes/OSXServer (local, journaled)
/dev/disk0s6 on /Volumes/Leopard (local, journaled)
/dev/disk0s8 on /Volumes/Extras (local, journaled)
automount -nsl [127] on /Network (automounted)
automount -fstab [132] on /automount/Servers (automounted)
automount -static [132] on /automount/static (automounted)
/dev/disk1s2 on /Volumes/Mastro (local, nodev, nosuid, journaled)
super:~ gtoso$
-
Last 2 screenshots (mkdir /Volumes/pippo).
Edit:
From graphics the mountpoints in /Volumes seem alias that point to oneself!
-
One step forward :o
I changed in foldertest.cpp
CPath dirName = sharedDir.GetFirstFile(CDirIterator::Dir);
to:
CPath dirName = sharedDir.GetFirstFile(CDirIterator::Any);
and it works, it shows all files including mountpoints!!!
Now the problem is:
it must show only the directories, but the Mac mountpoints are seen as file ???
from FileFunctions.h:
File = wxDIR_FILES | wxDIR_HIDDEN
Dir = wxDIR_DIRS | wxDIR_HIDDEN
Any = wxDIR_FILES | wxDIR_DIRS | wxDIR_HIDDEN
So if with Dir they aren't shown then they are seen as wxDIR_FILES,
OSX problem or wxMac bug?
-
Does this kind of behaviour *ONLY* happen in the /Volumes folder? Or is this something which happens at other places as well? In any case, I could imagine a workaround based on the "/Volumes" name to solve this problem in aMule.
But depending on the correctness of the behaviour (is an alias for an directory a file?), we should fix this in wxMac.
-
It's a problem related to Volumes folde only. Volumes is a direcory where Mac OS X mount all drives attached to himself. If you are familiar to linux it's the sam concept. Make a folder in Volumes is like assign a "Letter" to a drive in Windows.
-
Does this kind of behaviour *ONLY* happen in the /Volumes folder?
Yes, at least during "normal Mac usage".
Or is this something which happens at other places as well?
It happens for any mountpoint so if I do:
mkdir pippo
/sbin/mount_ftp -o noautomounted -o browse ftp://gtoso@ftp.xxx.xxx /Users/gtoso/pippo
But Mac users use the Terminal very rarely and the OS automatically mounts anything on /Volumes.
In any case, I could imagine a workaround based on the "/Volumes" name to solve this problem in aMule.
I agree
But depending on the correctness of the behaviour (is an alias for an directory a file?), we should fix this in wxMac.
Emm it's a mystery, but I think so too.
Yes, an alias to a directory is an "empty" file, at least it seems so from shell/Darwin:
super:~/Desktop gtoso$ ls -la OWL
total 23640
drwxr-xr-x 7 gtoso gtoso 238 May 21 22:31 .
drwx------ 48 gtoso gtoso 1632 Sep 9 16:59 ..
-rw-r--r-- 1 gtoso gtoso 6148 May 21 22:31 .DS_Store
-rw-r--r-- 1 gtoso gtoso 6368180 Feb 5 2007 Owl-0.94.tar.gz
-rw-r--r-- 1 gtoso gtoso 5693848 Oct 29 2007 Owl-0.95.tar.gz
-rw-r--r-- 1 gtoso gtoso 26767 May 2 2006 Owl-0.9x-locale-Italian.tar.gz
drwxr-xr-x 38 gtoso gtoso 1292 May 21 22:31 owl-0.95
super:~/Desktop gtoso$ ls -la OWL\ alias
-rw-r--r-- 1 gtoso gtoso 0 Sep 9 16:59 OWL alias
super:~/Desktop gtoso$ file OWL\ alias
OWL alias: empty
super:~/Desktop gtoso$ if [ -f OWL\ alias ]; then echo ok; fi
ok
super:~/Desktop gtoso$ /Developer/Tools/GetFileInfo OWL\ alias
file: "/Users/gtoso/Desktop/OWL alias"
type: "fdrp"
creator: "MACS"
attributes: Avbstclinmedz
created: 09/09/2008 16:59:46
modified: 09/09/2008 16:59:46
super:~/Desktop gtoso$
The attribute "a" means "Alias file".
From Finder it's an alias of 664 byte (see image).
Until this point everything corresponds to information found around:
http://julipedia.blogspot.com/2007/01/mac-os-x-aliases-and-symbolic-links.html
But mountpoints are strange:
from Darwin they are directory as in any *nix that I know
from Finder they seem alias...
super:~ gtoso$ mkdir prova
super:~ gtoso$ file prova
prova: directory
super:~ gtoso$ ls -la |grep prova
drwxr-xr-x 2 gtoso gtoso 68 Sep 9 17:11 prova
super:~ gtoso$ ls -la prova/
total 0
drwxr-xr-x 2 gtoso gtoso 68 Sep 9 17:11 .
drwxr-xr-x 253 gtoso gtoso 8602 Sep 9 17:11 ..
super:~ gtoso$ /Developer/Tools/GetFileInfo prova
directory: "/Users/gtoso/prova"
attributes: avbstclinmedz
created: 09/09/2008 17:11:12
modified: 09/09/2008 17:11:12
super:~ gtoso$ /sbin/mount_ftp -o noautomounted -o browse ftp://gtoso@ftp.tor.it /Users/gtoso/prova
super:~ gtoso$ file prova
prova: directory
super:~ gtoso$ ls -la |grep prova
dr-xr-xr-x 1 gtoso gtoso 512 Sep 9 17:12 prova
super:~ gtoso$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s3 19G 16G 2.0G 89% /
devfs 114K 114K 0B 100% /dev
fdesc 1.0K 1.0K 0B 100% /dev
<volfs> 512K 512K 0B 100% /.vol
/dev/disk0s5 9.9G 9.8G 93M 99% /Volumes/OSXServer
/dev/disk0s6 8.8G 4.4G 4.4G 50% /Volumes/Leopard
/dev/disk0s8 37G 36G 1.0G 97% /Volumes/Extras
automount -nsl [127] 0B 0B 0B 100% /Network
automount -fstab [132] 0B 0B 0B 100% /automount/Servers
automount -static [132] 0B 0B 0B 100% /automount/static
/dev/disk1s2 91G 68G 24G 74% /Volumes/Mastro
ftp://gtoso@ftp.tor.it 1.0G 1.0G 0B 100% /Users/gtoso/prova
super:~ gtoso$ /Developer/Tools/GetFileInfo prova
directory: "/Users/gtoso/prova"
attributes: avbstclinmedz
created: 01/01/1904 01:00:00
modified: 09/09/2008 17:13:23
super:~ gtoso$ if [ -d /Users/gtoso/prova ]; then echo ok; fi
ok
super:~ gtoso$ /Developer/Tools/GetFileInfo prova
directory: "/Users/gtoso/prova"
attributes: avbstclinmedz
created: 01/01/1904 01:00:00
modified: 09/09/2008 17:15:15
super:~ gtoso$ ls -la |grep prova
dr-xr-xr-x 1 gtoso gtoso 512 Sep 9 17:15 prova
super:~ gtoso$ kill -15 18399
super:~ gtoso$ ls -la |grep prova
drwxr-xr-x 2 gtoso gtoso 68 Sep 9 17:11 prova
super:~ gtoso$
However I think we should first investigate how wxMac recognizes a directory...
-
Does this kind of behaviour *ONLY* happen in the /Volumes folder?
Yes, at least during "normal Mac usage".
But mountpoints are strange:
from Darwin they are directory as in any *nix that I know
from Finder they seem alias...
However I think we should first investigate how wxMac recognizes a directory...
Ignore all the rest,
I'm sorry for the confusion but I think that volumes/mountpoints are directory, regardless of how Finder represents them...
The only problem is to understand because they are seen as wxDIR_FILES.
super:~ gtoso$ ls -la /Volumes/
total 24
drwxrwxrwt 8 root admin 272 Sep 9 15:23 .
drwxrwxr-t 30 root admin 1122 Sep 8 10:56 ..
-rw-rw-rw- 1 administ admin 6148 Sep 9 14:02 .DS_Store
drwxrwxr-t 12 root admin 510 Mar 14 12:38 Extras
drwxrwxr-t 9 root admin 408 Aug 16 19:16 Leopard
drwxr-xr-x 9 gtoso gtoso 408 Sep 9 17:20 Mastro
lrwxr-xr-x 1 root admin 1 Sep 3 13:44 OSX -> /
drwxrwxr-t 34 root admin 1258 Feb 18 2007 OSXServer
super:~ gtoso$ stat /Volumes/Mastro
234881032 2 drwxr-xr-x 9 gtoso gtoso 0 408 "Sep 9 18:03:58 2008" "Sep 9 17:20:45 2008" "Sep 9 17:20:45 2008" 4096 0 0 /Volumes/Mastro
super:~ gtoso$ cat testdir.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
struct stat stbuf;
int main (int argc, char ** argv) {
if (argc != 2) exit(-1);
printf("%s: ", argv[1]);
if (stat(argv[1], &stbuf) == -1) exit(-1);
if ((stbuf.st_mode & S_IFMT) == S_IFDIR)
printf("DIR\n");
else
printf("NO DIR\n");
exit(0);
}
super:~ gtoso$ ./testdir /Volumes/Mastro
/Volumes/Mastro: DIR
super:~ gtoso$
-
Maybe I found the bug, but I'm confused ???
I worked on wuischke foldertest and now it works fine, it finds all the directories (mountpoints and even symlinks to directories included).
But I haven't changed the code, only added wxMac src/unix/dir.cpp to files passed to g++ !!!
So instead of:
WXCONFIG='../wxMac-2.8.8/osx-build/wx-config'
`$WXCONFIG --cxx` `$WXCONFIG --cxxflags` `$WXCONFIG --libs` foldertest.cpp Path.cpp StringFunctions.cpp FileFunctions.cpp -o foldertest
cp foldertest foldertest.app/Contents/MacOS/
I used:
WXBASE='../wxMac-2.8.8'
WXCONFIG="$WXBASE/osx-build/wx-config"
`$WXCONFIG --cxx` `$WXCONFIG --cxxflags` `$WXCONFIG --libs` foldertest.cpp Path.cpp StringFunctions.cpp FileFunctions.cpp $WXBASE/src/unix/dir.cpp -o foldertest
cp foldertest foldertest.app/Contents/MacOS/
Tested on Tiger PCC, if someone with Leopard can try.
New zip attached.
-
I'm not expert of C++ or WxWidgets but IMHO this seems strange.
I refer to what I said in the previous post and confirmed by these tests.
Test1: testdir
"Is a dir?" C compiled normally (gcc -W -Wall -pedantic testdir.c -o testdir)
super:~/mulo/testdir gtoso$ cat testdir.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
struct stat stbuf;
int main (int argc, char ** argv) {
if (argc != 2) exit(-1);
printf("%s: ", argv[1]);
if (stat(argv[1], &stbuf) == -1) exit(-1);
if ((stbuf.st_mode & S_IFMT) == S_IFDIR)
printf("DIR\n");
else
printf("NO DIR\n");
exit(0);
}
super:~/mulo/testdir gtoso$ ls -la /Volumes/
total 24
drwxrwxrwt 8 root admin 272 Sep 11 21:37 .
drwxrwxr-t 30 root admin 1122 Sep 11 21:23 ..
-rw-rw-rw- 1 administ admin 6148 Sep 9 14:02 .DS_Store
drwxrwxr-t 12 root admin 510 Mar 14 2008 Extras
drwxrwxr-t 9 root admin 408 Aug 16 19:16 Leopard
drwxr-xr-x 9 gtoso gtoso 408 Sep 9 17:20 Mastro
lrwxr-xr-x 1 root admin 1 Sep 11 21:23 OSX -> /
drwxrwxr-t 34 root admin 1258 Feb 18 2007 OSXServer
super:~/mulo/testdir gtoso$ ls -la /Developer
lrwxr-xr-x 1 root admin 25 Nov 19 2007 /Developer -> /Volumes/Extras/Developer
super:~/mulo/testdir gtoso$ ./testdir /Volumes
/Volumes: DIR
super:~/mulo/testdir gtoso$ ./testdir /Volumes/Mastro
/Volumes/Mastro: DIR
super:~/mulo/testdir gtoso$ ./testdir /Developer
/Developer: DIR
super:~/mulo/testdir gtoso$ ./testdir /Volumes/.DS_Store
/Volumes/.DS_Store: NO DIR
super:~/mulo/testdir gtoso$
Test2: testdir2
As testdir but in mypseudo C++ using wxDir::Exists
It works fine returning the same results of testdir only more big:
-rwxr-xr-x 1 gtoso gtoso 14268 Sep 12 15:48 testdir
-rwxr-xr-x 1 gtoso gtoso 1794208 Sep 12 15:50 testdir2
super:~/mulo/testdir gtoso$ cat testdir2.cpp
#include <stdio.h>
#include <stdlib.h>
#include <wx/dir.h>
#include <wx/filefn.h>
struct stat stbuf;
int main (int argc, char ** argv) {
if (argc != 2) exit(-1);
wxString file (argv[1], wxConvUTF8);
printf("%s: ", argv[1]);
if (wxDir::Exists(file))
printf("DIR\n");
else
printf("NO DIR\n");
exit(0);
}
super:~/mulo/testdir gtoso$ cat compile2
`../wxMac-2.8.8/osx-build/wx-config --cxx` `../wxMac-2.8.8/osx-build/wx-config --cxxflags` `../wxMac-2.8.8/osx-build/wx-config --libs` testdir2.cpp -o testdir2
super:~/mulo/testdir gtoso$ ./testdir2 /
/: DIR
super:~/mulo/testdir gtoso$ ./testdir2 /Volumes
/Volumes: DIR
super:~/mulo/testdir gtoso$ ./testdir2 /Volumes/Mastro
/Volumes/Mastro: DIR
super:~/mulo/testdir gtoso$ ./testdir2 /Developer
/Developer: DIR
super:~/mulo/testdir gtoso$ ./testdir2 testdir2.cpp
testdir2.cpp: NO DIR
super:~/mulo/testdir gtoso$
Test3: testdir3
"What dirs this dir contains?" C++ using wxDir::GetFirst
This seems the problem...
super:~/mulo/testdir gtoso$ cat testdir3.cpp
#include <stdio.h>
#include <stdlib.h>
#include <wx/dir.h>
#include <wx/filefn.h>
int main (int argc, char ** argv) {
if (argc != 2) exit(-1);
wxString file (argv[1], wxConvUTF8);
printf("%s:\n", argv[1]);
wxDir dir(file);
if ( !dir.IsOpened() ) {
exit(-1);
}
wxString filename;
bool cont = dir.GetFirst(&filename, wxEmptyString, wxDIR_DIRS);
while ( cont ) {
printf("%s\n", (const char *) filename.mb_str());
cont = dir.GetNext(&filename);
}
exit(0);
}
super:~/mulo/testdir gtoso$ cat compile3
`../wxMac-2.8.8/osx-build/wx-config --cxx` `../wxMac-2.8.8/osx-build/wx-config --cxxflags` `../wxMac-2.8.8/osx-build/wx-config --libs` testdir3.cpp -o testdir3
super:~/mulo/testdir gtoso$ ./testdir3 /
/:
Applications
Library
opt
System
Users
super:~/mulo/testdir gtoso$ ./testdir3 /Volumes
/Volumes:
super:~/mulo/testdir gtoso$
But compiling it with dir.cpp it works,
why? ???
super:~/mulo/testdir gtoso$ cat compile3.new
`../wxMac-2.8.8/osx-build/wx-config --cxx` `../wxMac-2.8.8/osx-build/wx-config --cxxflags` `../wxMac-2.8.8/osx-build/wx-config --libs` ../wxMac-2.8.8/src/unix/dir.cpp testdir3.cpp -o testdir3.1
super:~/mulo/testdir gtoso$ ./testdir3.1 /
/:
Applications
automount
bin
cores
dev
Developer
etc
Library
Network
opt
private
sbin
System
tmp
Users
usr
var
Volumes
super:~/mulo/testdir gtoso$ ./testdir3.1 /Volumes
/Volumes:
Extras
Leopard
Mastro
OSX
OSXServer
super:~/mulo/testdir gtoso$
It doesn't show hidden dirs because I used only wxDIR_DIRS and not wxDIR_HIDDEN.
EDIT:
testdir3 doesn't show hidden dirs,
testdir3.1 linked to unix dir.cpp doesn't show dirs beginning with dot but it shows dirs with invisible attribute.
-
Thanks for this further research, I'll try to make sense of it tomorrow or Sunday.
-
Test3: testdir3
"What dirs this dir contains?" C++ using wxDir::GetFirst
This seems the problem...
But compiling it with dir.cpp it works,
why? ???
GRRRRRRR('")£(r£"b)')£
I understand!!!!
In Mac during wxMac compilation,
src/unix/dir.cpp is not used...
It use src/mac/carbon/dirmac.cpp that I think is bugged...maybe...
-
Thanks for this further research, I'll try to make sense of it tomorrow or Sunday.
Good,
maybe I just found the bugged file: src/mac/carbon/dirmac.cpp
but I'm not sure
-
gtoso, you may want to test the following:
in src/mac/carbon/dirmac.cpp: wxDirData::Read(), before each "continue" statement add some debugging output to see why and what is skipped; for example: wxASSERT(wxT("skipped ") + name + wxT(" because ...")); (add proper '{' and '}' braces too; you may also use the wxLog facility, ...).
This way we can find out if FSGetCatalogInfoBulk fails to find those items or wx skips them for whatever reason.
(For wxASSERT to work you have to compile wx in debug-enabled mode.)
-
GonoszTopi I will try...
For now I made some test using dirt printf without results:
kFSNodeIsDirectoryMask see mountpoints as files!
I tried to use sharingFlags without success.
Some usefull info here:
http://developer.apple.com/documentation/Carbon/Reference/File_Manager/Reference/reference.html
-
If neither nodeFlags nor sharingFlags work, I have no idea.
-
I have one - hack wx for aMule packages to replace dirmac.cpp by unix/dir.cpp and report this as a bug (they should use the unix-dir.cpp, too) to wxWidgets.
What do you think? If you agree, I'll contact wx developers.
-
Sorry for the very long delay...
I'm very busy in this period.
I have one - hack wx for aMule packages to replace dirmac.cpp by unix/dir.cpp and report this as a bug (they should use the unix-dir.cpp, too) to wxWidgets.
What do you think? If you agree, I'll contact wx developers.
I think that it's ok for amule,
but in general maybe there are some problems:
the hidden files are not seen as hidden,
it works for gcc and mach-o binaries,
but it may not work for Carbon/Classic applications and other compilers as CodeWarrior...
But it's the only solution I found:
I made other tests and tried this:
http://developer.apple.com/samplecode/FSMegaInfo/listing10.html
and I haven't found a clean way to find all directories or to list all mounted volumes.
So I replaced mac/carbon/dirmac.cpp with unix/dir.cpp and compiled the new wxMac.
I recompiled aMule 2.2.2 and I'm going to test it asap.
Now I leave my mac compile today SVN.
-
What do you think? If you agree, I'll contact wx developers.
Contact wx developers is a very good idea.
PS: You are already returned to home or are you still in Italy?
-
Thank you for your efforts. I don't know if I make soon to contact the wxmac devs, but I'll post a link when I do.
Ah. once you have updated Mac binaries, please feel free to post a news update for the front page and we'll also upload the new binaries to sourceforge.
I left Italy yesterday. :( On a side note, it's amazing with how much crap you suddenly have to deal when you return after only 3 months...(insert a couple of curses here)
-
Mailing list post: http://lists.wxwidgets.org/pipermail/wx-dev/2008-October/107939.html