Browse Source

Terminado

master
kevin 2 years ago
parent
commit
331fbf229f
2 changed files with 21 additions and 1 deletions
  1. BIN
      bin/dam/daw/com/es/HolaFichero.class
  2. +21
    -1
      src/dam/daw/com/es/HolaFichero.java

BIN
bin/dam/daw/com/es/HolaFichero.class View File


+ 21
- 1
src/dam/daw/com/es/HolaFichero.java View File

@ -1,5 +1,8 @@
package dam.daw.com.es; package dam.daw.com.es;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
public class HolaFichero { public class HolaFichero {
@ -33,11 +36,28 @@ public class HolaFichero {
public static void CreoFicheroWindows() throws IOException { public static void CreoFicheroWindows() throws IOException {
System.out.println("Creando fichero en Windows ..."); System.out.println("Creando fichero en Windows ...");
File fwindows = new File("C:\\Users\\kevin\\Documents\\CreoFicheroWindows.txt");
File fwindows = new File("C:\\Users\\kevin\\Documents\\workspace-spring-tool-suite-4-4.16.0.RELEASE\\CreoFicheroWindows.txt");
if (!fwindows.exists()) { if (!fwindows.exists()) {
fwindows.createNewFile(); fwindows.createNewFile();
} }
System.out.println("Fichero creado en Windows."); System.out.println("Fichero creado en Windows.");
// check if the fwindows exists
boolean exists = fwindows.exists();
if(exists == true)
{
// printing the permissions associated with the file
System.out.println("Executable: " + fwindows.canExecute());
System.out.println("Readable: " + fwindows.canRead());
System.out.println("Writable: "+ fwindows.canWrite());
}
else
{
System.out.println("File not found.");
}
} }
public void CreoFicheroLinux() throws IOException { public void CreoFicheroLinux() throws IOException {


Loading…
Cancel
Save