[erlang-questions] Problem in file:rawopen/2

Matthias Lang <>
Sun Feb 24 12:42:13 CET 2008


 >  > > Sumith Gamage writes:

 >  > >  > I use following code segment to copy directory in Linux.

 >  > >  >     {ok, OutFd} = file:rawopen(Dest, {binary, write}),

 >  > >  > It works fine

If I ignore your claim that the posted code copies a directory,
i.e. assume that nothing clever is going on, then everything gets much
less unlikely*. You probably just want to use

  file:open(Src, [binary, read, raw])

and

  file:open(Dest, [binary, write, raw])call, with the options [raw, 

Matt

 * I say that because attempting to open a directory doesn't even
   work on linux. It probably hasn't worked on any unix for about 15
   years.



More information about the erlang-questions mailing list