Doc Comments / Phobos /
Std Recls
std.recls
There is a dsource project for recls, but there's not really anything there. Instead, go to http://recls.org/downloads.html (a/k/a http://synesis.com.au/software/recls/downloads.html).
|
|
Questions
Q: Is the latest recls going into next Phobos?
A: No, actually std.recls is going to be removed from Phobos. A D port of recls will still be available.
Q: Is there a binary for Windows people who like to be on the cutting-edge, but are too lazy to recompile it?
A: Yes. For those who continue to suffer the out-of-date std.recls in Phobos, I've posted the binaries.
Q: How does one recompile phobos on Linux?
A: With the version of recls that shipped w/ DMD v0.119, and compiling with GCC ge. v3.3.x, replace the following in etc/c/stlsoft/stlsoft_null.h:
private: // line 191 void operator &() const;with:NULL_v(NULL_v const &); NULL_v const &operator =(NULL_v const &);
private: // line 191 void operator &() const; public: NULL_v(NULL_v const &); private: NULL_v const &operator =(NULL_v const &);It could be a compiler issue - I didn't look into it that far. I think I sent something into stlsoft on this issue last year.
Q: How does one compile the new recls from the STLsoft website?
A: Ok, here's the fast version:
- If you don't have it yet, you need to install a version of the Digital Mars C/C++ compiler. A free version is available. Installation is pretty simple, just extract to your hard drive ("C:\" is usually a convenient location).
- You also need to have STLport installed (available from the same page as the free DMC compiler) if it's not already. You should extract it to put it into the \dm directory. Add
to the beginning of INCLUDE line of \dm\bin\sc.ini so that DMC can find it when it needs it."%@P%\..\stlport\stlport";
- Download and install STLSoft 1.8.3 beta 4. Wherever you put it - e.g. C:\3pty\STLSoft\1.8.3 or /usr/include/stlsoft/1.8.3 - you need to setup and environment variable STLSOFT_INCLUDE (e.g.
) that points to the directory containing stlsoft.h. The other headers that are in relative directories - e.g. winstl/path.hpp - are under that main directory. Note: recls 1.6.x also uses some of the "in progress" STLSoft components - things that are very likely to go in on the next non-beta release - but the recls makefiles contain include directorives for both "-I$(STLSOFT_INCLUDE)" and "-I$(STLSOFT_INCLUDE)/inprogress", so you shouldn't have to worry about that. (Just FYI, in case <g>)set STLSOFT_INCLUDE=c:\dm\stlsoft
- Say you're building recls for DMC++ on Win32. You'll need to be in a CLI which has the STLSOFT_INCLUDE environment set, and can see the DMC++ toolset. Then go to the <recls>/build/dm directory, and just type "make". Or type "make test" and it'll run the sample programs after a successful build.
- If the early steps are set up right, which should mean that the DMC version of recls builds ok, then you'll have recls.dm.lib and recls.dm.debug.lib in the <recls>/lib directory. That contains all the core library, and 'll need to be linked in to your exe
- Then just go to <recls>/mappings/D, and compile <recls>/mappings/D/std/recls.d. If you like, you can use the makefile there, and just type "make". You can also do this manually (e.g.,
). Assuming DMD is successfully installed and all components visible, you should have the libraries recls.D.debug.lib and recls.D.lib, which, along with the core library, can be linked to form you exe. Hence, you should specify either both recls.D.lib+recls.dm.lib (the release versions of the recls/D mapping and the recls core library), or recls.D.debug.lib+recls.dm.debug.lib (the debug versions of the recls/D mapping and the recls core library).dmd -c std\recls.d c:\dm\recls-1.6.1\lib\recls.dm.lib lib -c c:\dm\recls-1.6.1\lib\recls.D.lib recls.obj
- You should try compiling a short test program, such as this one:
I got it to compile like this:import std.recls; void main() { FileSearch search = new FileSearch(".", "*.*", RECLS_FLAG.RECLS_F_RECURSIVE); foreach(Entry entry; search) { with(entry) { if(!shortFile()) printf("%.*s%.*s\n", directoryPath(), file()); else printf("%.*s%.*s (%.*s)\n", directoryPath(), file(), shortFile()); } } }
(My wininet.lib version is available from http://svn.dsource.org/projects/bindings/trunk/lib/).dmd test.d c:\dm\recls-1.6.1\lib\recls.dm.lib c:\dm\recls-1.6.1\lib\recls.D.lib wininet.lib -Ic:\dm\recls-1.6.1\mappings\D
See also: NG:digitalmars.D/20177, NG:digitalmars.D/20178
Correction
Shouldn't
FileSearch s = new FileSearch("H:\SynSoft\D\phobos\", "s??",be
FileSearch s = new FileSearch("H:\\SynSoft\\D\\phobos\\", "s??",or
FileSearch s = new FileSearch(r"H:\SynSoft\D\phobos\", "s??",
Comments
Add your comments here...
Links
Corresponding page in the D Specification (link no longer exists)