My favorites
▼
|
Sign in
lineadecodigo
Web Code Samples in spanish
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
lineadecodigo_java
/
src
/
com
/
lineadecodigo
/
java
/
file
/
VaciarContenidoFichero2.java
r478
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.lineadecodigo.java.file;
import java.io.File;
import java.io.IOException;
/**
* @file VaciarContenidoFichero2.java
* @version 1.0
* @author Linea de Codigo (http://lineadecodigo.com)
* @date 31-julio-2010
* @url http://lineadecodigo.com/java/vaciar-el-contenido-de-un-fichero-mediante-borrado-y-creacion/
* @description Vaciar el contenido de un fichero borrandolo y volviéndolo a crear.
*/
public class VaciarContenidoFichero2 {
public static void main(String[] args) {
String sFichero = "fichero1.txt";
File f = new File(sFichero);
// Borramos el fichero
f.delete();
try {
f.createNewFile();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}
Show details
Hide details
Change log
r265
by vcuervo on Jul 31, 2010
Diff
Vaciar el contenido de un fichero mediante borrado y creación
Go to:
...ile/VaciarContenidoFichero2.java
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 748 bytes, 33 lines
View raw file
Powered by
Google Project Hosting