diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..fb50116 --- /dev/null +++ b/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..5edca09 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + MiVentana + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/Salida.dat b/Salida.dat new file mode 100644 index 0000000..e69de29 diff --git a/bin/jorpelu/com/MyCopy.class b/bin/jorpelu/com/MyCopy.class new file mode 100644 index 0000000..1d33c74 Binary files /dev/null and b/bin/jorpelu/com/MyCopy.class differ diff --git a/bin/jorpelu/com/Ventana.class b/bin/jorpelu/com/Ventana.class new file mode 100644 index 0000000..6d8ce9c Binary files /dev/null and b/bin/jorpelu/com/Ventana.class differ diff --git a/bin/module-info.class b/bin/module-info.class index e2e1959..37079b4 100644 Binary files a/bin/module-info.class and b/bin/module-info.class differ diff --git a/src/jorpelu/com/MyCopy.java b/src/jorpelu/com/MyCopy.java new file mode 100644 index 0000000..09864ca --- /dev/null +++ b/src/jorpelu/com/MyCopy.java @@ -0,0 +1,70 @@ +package jorpelu.com; + +import java.io.*; +import java.util.ArrayList; +import java.util.Scanner; + + +public class MyCopy { + static Scanner sc = new Scanner(System.in); + public MyCopy(){ + + String ficheroString = sc.next(); + File fich = new File(".\\Salida.dat"); + File fich_a_copiar = new File(ficheroString); + if(fich_a_copiar.exists() == false) { + try { + fich_a_copiar.createNewFile(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + String[] calculando = {"-", "\\", "|", "/"}; + + FileInputStream in; + try { + in = new FileInputStream(fich_a_copiar); + + DataInputStream din = new DataInputStream(in); + FileOutputStream out = new FileOutputStream(fich); + DataOutputStream dout = new DataOutputStream(out); + + int cal=0; + int i=0; + int c; + ArrayList bufferin = new ArrayList(); + + while((c =din.read()) != -1 && bufferin.add(c)) { + System.out.println(calculando[cal]); + cal++; + if (cal >= 4) + cal = 0; + } + + for(int j = 0; j