John Joyce
8/14/2007 3:15:00 PM
On Aug 14, 2007, at 9:24 AM, Bertram Scharpf wrote:
> Hi,
>
> Am Dienstag, 14. Aug 2007, 22:40:58 +0900 schrieb dblack@rubypal.com:
>> On Tue, 14 Aug 2007, Bertram Scharpf wrote:
>>> First think, then write. Sorry!
>>
>> Please leave the snideness and nastiness out of it. They add nothing
>> but snideness and nastiness.
>
> I didn't mean it as harmful as it obviously sounds. Sorry,
> again.
Then take your own advice about thinking first and then writing, friend.
No offense taken, I know I'm not the only one who writes something
and posts quickly because there are other things to do.
I wasn't trying to give a 100% perfect solution, just a quick example
idea of what could be done.
Lack of the end token would be caught by the interpreter and the OP
would notice or learn from it anyway.
everybody forgets an end here and there.
As for hidden files, well that's somebody else's problem, isn't it?
Depending on point of view, a directory only containing hidden files
could be considered empty!
So whether or not those files are important depends on the program's
needs.
In that case, hidden or not should be an optional argument with a
default.
That said, though we really have to ask what is meant by empty?
Directories on many platforms contain hidden files or hidden
symlinks. I think that calls for more than one method definition to
handle those respective distinctions.
hidden_files_in_dir?(path_to_dir)
symlinks_in_dir?(path_to_dir)
As is often the case, d.a.b. has the most concise solution...