Elixir's File
module provides a lot of methods to make working with files and
the file system easy and comfortable. In today's episode, we're going to cover
the first part of the File module:
cd
chgrp
chmod
chown
close
copy
--(jadams@jibbajabba)-(31/pts/14)-(2038/01-Mar-14)-- | |
--($:~/elixir/phoenix)(render_haml_with_calliope)ruby-2.0.0-p247@system-- | |
$ mix test | |
warning: the dependency ex_conf requires Elixir "~> 0.12.4" but you are running on v0.13.0-dev, please run mix deps.update ex_conf to update it | |
warning: the dependency calliope requires Elixir "~> 0.12.0" but you are running on v0.13.0-dev, please run mix deps.update calliope to update it | |
Compiled lib/phoenix.ex | |
Compiled lib/mix/tasks/phoenix.ex | |
Compiled lib/mix/tasks/phoenix/routes.ex | |
Compiled lib/mix/tasks/phoenix/new.ex | |
Compiled lib/phoenix/config/app.ex |
--(jadams@jibbajabba)-(12/pts/13)-(2220/03-Feb-14)-- | |
--($:~/erlang/hello_jinterface)ruby-2.0.0-p247@system-- | |
$ erl -name [email protected] -setcookie test | |
Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false] | |
Eshell V5.10.4 (abort with ^G) | |
([email protected])1> hello_jinterface:start(). | |
true | |
([email protected])2> nodes(). | |
[] |
defmodule MyCopter do | |
import ExCopter.Command.Client | |
def demo do | |
IO.puts "Taking off..." | |
takeoff | |
for 2000 do: :nothing | |
IO.puts "Spinning..." | |
for 3500, do: spin_left(25) |
--(jadams@jibbajabba)-(44/pts/16)-(2230/04-Jan-14)-- | |
--($:~/elixir/markdown_server)(master)ruby-2.0.0-p353@markdown_server-- | |
$ relx -l ~/elixir/elixir/lib/ -V3 | |
===> Starting relx build process ... | |
===> state(command_line): | |
log: (3:debug), | |
config file: | |
goals: | |
output_dir: /home/jadams/elixir/markdown_server/_rel | |
lib_dirs: |
--(jadams@jibbajabba)-(19/pts/19)-(2205/04-Jan-14)-- | |
--($:~/erlang/relx)(master)ruby-2.0.0-p247@system-- | |
$ make | |
/home/jadams/bin/rebar skip_deps=true compile | |
==> relx (compile) | |
include/relx.hrl:19: can't find include lib "erlware_commons/include/ec_cmd_log.hrl" | |
ERROR: compile failed while processing /home/jadams/erlang/relx: rebar_abort | |
make: *** [compile] Error 1 |
Elixir's File
module provides a lot of methods to make working with files and
the file system easy and comfortable. In today's episode, we're going to cover
the first part of the File module:
cd
chgrp
chmod
chown
close
copy
iex(23)> out = Enum.reduce([4], <<>>, fn(elem, accum) -> accum <> <<elem :: size(4)>> end) | |
<<4::size(4)>> | |
iex(24)> <<4::size(4)>> <> <<5::size(4)>> | |
"E" | |
iex(25)> out <> <<5::size(4)>> | |
** (ArgumentError) argument error | |
iex(25)> out == <<4::size(4)>> | |
true |
taData@65685e97{parameters=[null] factoryClass=org.jboss.virtual.spi.cache.VFSCacheFactory factoryMet[2371/3100$│············································································································································································································ | |
ance} autowireCandidate=true start=AbstractLifecycleMetaData@271a3f84{ whenRequired=ControllerState@6d1b5ecf{Sta│············································································································································································································ | |
rt} parameters= }}, AbstractBeanMetaData@1fed9fff{name=VfsNamesExceptionHandler bean=org.jboss.virtual.plugins.c│············································································································································································································ | |
ontext.helpers.NamesExceptionHandler properties= constructor=AbstractC |
2013-12-09T21:05:46+00:00 heroku[slug-compiler]: Slug compilation finished | |
2013-12-09T21:30:04.284744+00:00 heroku[api]: Scale to web=1 by [email protected] | |
2013-12-09T21:30:21.480096+00:00 heroku[web.1]: State changed from starting to crashed | |
2013-12-09T21:30:21.480096+00:00 heroku[web.1]: State changed from crashed to starting | |
2013-12-09T21:30:27.345225+00:00 heroku[web.1]: Starting process with command `MIX_ENV=prod ./start.sh` | |
2013-12-09T21:30:31.605772+00:00 app[web.1]: * Compiling mimetypes | |
2013-12-09T21:30:31.606068+00:00 app[web.1]: I can install a local copy which is just used by mix | |
2013-12-09T21:30:31.606068+00:00 app[web.1]: Could not find rebar, which is needed to build mimetypes | |
2013-12-09T21:30:31.615125+00:00 app[web.1]: Shall I install this local copy? [Yn] ** (Mix) Could not find rebar to compile dependency mimetypes, please ensure rebar is available | |
2013-12-09T21:30:32.257357+00:00 app[web.1]: Warning: could not run smart terminal, falling back to dumb one |
1) test we can store logs (ElixiakPlaygroundTest) | |
** (MatchError) no match of right hand side value: {:error, "{error,{indexes_not_supported,riak_kv_bitcask_backend}}"} | |
stacktrace: | |
test/elixiak_playground_test.exs:2: Log.find/1 | |
test/elixiak_playground_test.exs:22: ElixiakPlaygroundTest."test we can store logs"/1 |