elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado:


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Ruby] Funcion savefile()
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Ruby] Funcion savefile()  (Leído 1,363 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Ruby] Funcion savefile()
« en: 10 Febrero 2012, 21:02 pm »

Una simple funcion en ruby para escribir en un archivo de texto.

Código
  1. #!usr/bin/ruby
  2. #Funcion savefile()
  3. #Coded By Doddy H
  4.  
  5. def savefile(file,text)
  6.  save = File.open(file, "a")
  7.  save.puts text+"\n"
  8.  save.close
  9. end
  10.  
  11. savefile("test.txt","probando")
  12.  
  13. #The End ?
  14.  
  15.  
  16.  


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Perl] Funcion savefile()
Scripting
BigBear 0 1,555 Último mensaje 11 Octubre 2011, 18:10 pm
por BigBear
[Ruby] Funcion tomar()
Scripting
BigBear 0 1,377 Último mensaje 10 Febrero 2012, 19:01 pm
por BigBear
[Ruby] Funcion toma()
Scripting
BigBear 0 1,400 Último mensaje 10 Febrero 2012, 19:02 pm
por BigBear
[Ruby] Funcion speak()
Scripting
BigBear 0 1,387 Último mensaje 10 Febrero 2012, 19:02 pm
por BigBear
[Ruby] Funcion openwords()
Scripting
BigBear 0 1,361 Último mensaje 10 Febrero 2012, 21:03 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines