Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replace use of regexp module with re
This gets rid of the following compiler warning:

  the regexp module is deprecated (will be removed in R15A); use the re
  module instead
  • Loading branch information
seth committed Jun 23, 2009
1 parent c7dac72 commit 78dbed8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/webmachine_skel.erl
Expand Up @@ -45,7 +45,8 @@ skel() ->
"skel".

skelcopy(Src, DestDir, Name, LDst) ->
{ok, Dest, _} = regexp:gsub(filename:basename(Src), skel(), Name),
Dest = re:replace(filename:basename(Src), skel(), Name,
[global, {return, list}]),
case file:read_file_info(Src) of
{ok, #file_info{type=directory, mode=Mode}} ->
Dir = DestDir ++ "/" ++ Dest,
Expand All @@ -66,7 +67,8 @@ skelcopy(Src, DestDir, Name, LDst) ->
{ok, #file_info{type=regular, mode=Mode}} ->
OutFile = filename:join(DestDir, Dest),
{ok, B} = file:read_file(Src),
{ok, S, _} = regexp:gsub(binary_to_list(B), skel(), Name),
S = re:replace(binary_to_list(B), skel(), Name,
[{return, list}, global]),
ok = file:write_file(OutFile, list_to_binary(S)),
ok = file:write_file_info(OutFile, #file_info{mode=Mode}),
io:format(" ~s~n", [filename:basename(Src)]),
Expand Down

0 comments on commit 78dbed8

Please sign in to comment.