function dir = cria_pasta(dir)
fprintf(2,'criando pasta %s\n',dir);
system(sprintf('mkdir -p %s',dir));