www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Not happy with std.recls

reply jicman <jicman_member pathlink.com> writes:
Greetings!  So, I have

12:17:18.96>dmd
Digital Mars D Compiler v0.149
Copyright (c) 1999-2006 by Digital Mars written by Walter Bright

and I have this very complicated program, copied from the std.recls
documentation:

|private import std.stdio;
|private import std.recls;
|
|int main(char[][] args)
|{
|  FileSearch s = new FileSearch("c:\\temp", "*.*", RECLS_FLAG.FILES);
|
|  foreach (Entry e; s)
|  {
|    writefln(e.path());
|    writefln(e.creationTime());
|  }
|  return(0);
|}

when I compile it, I get...

12:17:36.60>dmd test.d
test.d(6): identifier 'FileSearch' is not defined
test.d(6): FileSearch is used as a type
test.d(6): variable test.main.s voids have no value
test.d(6): identifier 'FileSearch' is not defined
test.d(6): FileSearch is used as a type
test.d(6): no property 'FILES' for type 'int'
test.d(6): new can only create structs, dynamic arrays or class objects, not
void's
test.d(6): cannot implicitly convert expression (new
FileSearch("c:\\temp","*.*",1)) of type void* to int
test.d(8): foreach: int is not an aggregate type

what is wrong with this program?  I am following the Documentation.

Anyone?

jic
Mar 17 2006
parent reply Sean Kelly <sean f4.ca> writes:
jicman wrote:
 
 what is wrong with this program?  I am following the Documentation.
The documentation for recls is out of synch with the implementation. I suggest using the search utilities in std.file instead, as it's likely recls will be removed from Phobos fairly soon. I believe Matthew has a recls project on dsource now which will contain an up-to-date version before too terribly long. Sean
Mar 17 2006
parent reply jicman <jicman_member pathlink.com> writes:
Sean Kelly says...
jicman wrote:
 
 what is wrong with this program?  I am following the Documentation.
The documentation for recls is out of synch with the implementation. I suggest using the search utilities in std.file instead, as it's likely recls will be removed from Phobos fairly soon. I believe Matthew has a recls project on dsource now which will contain an up-to-date version before too terribly long. Sean
Yeah, but I need to finish this today! UGH! I also need to use a file creationTime() which std.file has, partially and only on the content of a directory and not on an specific file. Hmmmm... Kids, this should be a lesson for you all: never leave your projects for the day it's due. alrighty, then. Back to the drawing board. I guess python could help me today. :-)
Mar 17 2006
parent reply jcc7 <jcc7_member pathlink.com> writes:
In article <dvf0rf$2008$1 digitaldaemon.com>, jicman says...
Sean Kelly says...
jicman wrote:
 
 what is wrong with this program?  I am following the Documentation.
The documentation for recls is out of synch with the implementation. I suggest using the search utilities in std.file instead, as it's likely recls will be removed from Phobos fairly soon. I believe Matthew has a recls project on dsource now which will contain an up-to-date version before too terribly long. Sean
Yeah, but I need to finish this today! UGH! I also need to use a file creationTime() which std.file has, partially and only on the content of a directory and not on an specific file. Hmmmm... Kids, this should be a lesson for you all: never leave your projects for the day it's due. alrighty, then. Back to the drawing board. I guess python could help me today. :-)
If you haven't given up on D yet, you can try the recls that's here: http://synesis.com.au/software/recls/downloads.html By the way, the DocComments wiki page for std.recls has some of this information: http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/Phobos/StdRecls And it's only a click away from the official documentation, too. jcc7
Mar 17 2006
parent reply jicman <jicman_member pathlink.com> writes:
jcc7 says...
In article <dvf0rf$2008$1 digitaldaemon.com>, jicman says...
Sean Kelly says...
jicman wrote:
 
 what is wrong with this program?  I am following the Documentation.
The documentation for recls is out of synch with the implementation. I suggest using the search utilities in std.file instead, as it's likely recls will be removed from Phobos fairly soon. I believe Matthew has a recls project on dsource now which will contain an up-to-date version before too terribly long. Sean
Yeah, but I need to finish this today! UGH! I also need to use a file creationTime() which std.file has, partially and only on the content of a directory and not on an specific file. Hmmmm... Kids, this should be a lesson for you all: never leave your projects for the day it's due. alrighty, then. Back to the drawing board. I guess python could help me today. :-)
If you haven't given up on D yet, you can try the recls that's here: http://synesis.com.au/software/recls/downloads.html
Given up on D? Are you crazy? :-) Nah...
By the way, the DocComments wiki page for std.recls has some of this
information: http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/Phobos/StdRecls
Ok, so I am stuck on step 4, the making of it.
And it's only a click away from the official documentation, too.
The official documentation is not right... :-)
Mar 17 2006
parent J C Calvarese <technocrat7 gmail.com> writes:
In article <dvffhe$2m09$1 digitaldaemon.com>, jicman says...
jcc7 says...
In article <dvf0rf$2008$1 digitaldaemon.com>, jicman says...
Sean Kelly says...
jicman wrote:
 
 what is wrong with this program?  I am following the Documentation.
The documentation for recls is out of synch with the implementation. I suggest using the search utilities in std.file instead, as it's likely recls will be removed from Phobos fairly soon. I believe Matthew has a recls project on dsource now which will contain an up-to-date version before too terribly long. Sean
Yeah, but I need to finish this today! UGH! I also need to use a file creationTime() which std.file has, partially and only on the content of a directory and not on an specific file. Hmmmm... Kids, this should be a lesson for you all: never leave your projects for the day it's due. alrighty, then. Back to the drawing board. I guess python could help me today. :-)
If you haven't given up on D yet, you can try the recls that's here: http://synesis.com.au/software/recls/downloads.html
Given up on D? Are you crazy? :-) Nah...
I meant for this particular project. ;) It sounded like you had a looming deadline and you might have to sacrifice the fun way for the way that works.
By the way, the DocComments wiki page for std.recls has some of this
information: http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/Phobos/StdRecls
Ok, so I am stuck on step 4, the making of it.
If you're on Windows, you could probably get the job done using the 1.6.1 binaries: http://recls.org/downloads.html#recls_1_6_1_dm_binaries If you're on Linux, I'm sorry but I don't know how to do anything on Linux.
And it's only a click away from the official documentation, too.
The official documentation is not right... :-)
I know the official documentation is not right. I don't think this particular page will ever be right, but at some point the page will probably disappear (which would be an improvement in this case). At least with the Comments pages, fellow users can trade hints and tips when Walter doesn't have time to fix the official documentation. jcc7
Mar 19 2006