ch 19, eunit: Why use ?cmd("rm filename") instead of file:delete("filename")

30 views
Skip to first unread message

Steven Wicklund

unread,
Jun 7, 2010, 6:19:39 PM6/7/10
to Erlang Programming
In chapter 19 the eunit tests use the ?cmd() macro instead of
file:delete/1. Why is this? I was getting a test exception using
this syntax(enoent) that went away when I switched to delete.
Some weirdness here: ?cmd is described as being OS dependent - I run
on Win7 so I tried using the "del" command to no avail, but now I
notice that several other tests use the ?cmd("rm ...") notation
successfully. Is ?cmd in fact OS specific, or will it translate a "rm
filename" to "del filename" on Windows?

Steven Wicklund

unread,
Jun 8, 2010, 9:57:35 AM6/8/10
to Erlang Programming
I figured out what that I was writing my test cases improperly and
that the ?cmd("rm...") fails every time.
Reply all
Reply to author
Forward
0 new messages