On Friday, January 30, 2015 10:39:44 Suliman via Digitalmars-d-learn wrote: > foreach(f; files)) > { > if (canFind(to!string(f), " ")) > { > writeln("whitespace found:"); > writeln(f); > Thread.sleep( dur!("msecs")( 50 ) ); // sleep for 50 > milliseconds > } > else > continue; > } > > Error: module app struct std.regex.Thread(DataIndex) is private > Error: no property 'sleep' for type 'void' > > What's wrong? Why sleeping do not work?
Did you import std.regex but not core.thread? Or did you import std.regex with a local import and core.thread with a module-level import? Unfortunately, private symbols are visible and can cause symbol conflicts (even though they can't actually be used), so sometimes we end up with conflicts due to private symbols. Being more specific - e.g. core.Thread.sleep() - should fix the problem. But it's also possible that you failed to import core.thread in the first place, in which case, Thread.sleep isn't even visible to your code. - Jonathan M Davis