[clean-list] Some examples about the Directory library

Jerzy Karczmarczuk karczma@info.unicaen.fr
Thu, 18 Dec 2003 12:03:05 +0100


Hugo Rufino wrote:

> I'm trying to use the functions of the Directory.dcl library, but I'm 
> having some difficult. For example: how to use the getDirectoryContents, 
> isHidden and getFileName functions??  
>  
> Could anyone help me with some examples?

========

Sorry, no answer. A question...
What's wrong with the following?

module dirmod
import StdEnv,StdIO,Directory

ff world = getDirectoryContents
   (AbsolutePath "D" [PathDown "\\Work"]) world

Start :: *World -> ([DirEntry],*World)
Start world
   # ((a,b),world) = ff world
   = (b,world)

//====


Here 'a' is the error code, I *didn't want to look at*.
But it caught me anyway. The program compiled and responded:

(fatal error: tried to evaluate an error value returned by
  function getDirectoryContents).

??


Thanks.


Jerzy Karczmarczuk