Advertisement
jsbsan

copia de archivos

Apr 18th, 2014
2,121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 0.45 KB | None | 0 0
  1. ' Gambas module file
  2.  
  3. Public Sub vaciarDirectorio(ruta As String, Optional patron As String) ''Borrar contenido de un directorio dado un patron de borrado
  4.   'borrado si existe la ruta
  5.  
  6.   Dim file As String
  7.  
  8.   If patron = "" Then patron = "*"
  9.   If Exist(ruta) Then
  10.     For Each File In Dir(ruta & "/", patron)
  11.       Try Kill ruta & "/" & file
  12.     Next
  13.   Endif
  14. Catch
  15.   Message.Error(("Error al intentar borrar el directorio: ") & ruta)
  16.  
  17. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement