Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: dir?

From: gscottjones:mchsi at: 30-Jun-2002 5:53

From: "Charles"
> Okay, here's a question regarding the dir? function. > Here's a little sample code: > > root: %/c/somedir/anotherdir/adir/ > sub: %bdir/ > foreach dir read join root sub [ > if (dir? dir) AND (none? find dir "TN-") [ > etcetcetc > ] > ] > > Problem is, when dir is, in fact, a directory, dir? is returning false. > I've no idea why, and my only fix around it is to use (dir? rejoin [root
sub
> dir]) .. Shouldn't dir? return true? It has in the past for me in a
similar
> situation... *boggle* Help?
Hi, Charles, I can more easily offer the fix rather than explain the problem. The short answer is that REBOL needs the path. Try: root: %/c/ sub: %rebol/ foreach file read full-path: join root sub [ if dir? join full-path file [print file] ] (This sample is, of course, changed to something that I could run and show the results.) Hope this gets you past the hurdle, but I, too, would like to more fully understand the distinction. --Scott Jones