Last update January 22, 2007

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).


ToDo:This material should be revised (and probably moved to another page) since std.recls was removed from Phobos in DMD 0.155.

Table of contents of this page
std.recls   
Questions   
Correction   
Comments   
Links   

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;

NULL_v(NULL_v const &); NULL_v const &operator =(NULL_v const &);

with:
 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:

  1. 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).
  2. 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
    "%@P%\..\stlport\stlport";
    to the beginning of INCLUDE line of \dm\bin\sc.ini so that DMC can find it when it needs it.
  3. 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.
    set STLSOFT_INCLUDE=c:\dm\stlsoft
    ) 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>)
  4. 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.
  5. 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
  6. 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.,
    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
    ). 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).
  7. You should try compiling a short test program, such as this one:
    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());
            }
        }
    }
    I got it to compile like this:
    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
    (My wininet.lib version is available from http://svn.dsource.org/projects/bindings/trunk/lib/).
Adapted from NG:digitalmars.D/20231


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)


FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: January 22, 2007 18:57 (diff))