Browse Source

Retoques

root
kevin 2 years ago
parent
commit
29b50c05db
2 changed files with 3 additions and 3 deletions
  1. BIN
      bin/dam/daw/com/es/HolaFicheroPermisos.class
  2. +3
    -3
      src/dam/daw/com/es/HolaFicheroPermisos.java

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


+ 3
- 3
src/dam/daw/com/es/HolaFicheroPermisos.java View File

@ -10,17 +10,17 @@ public class HolaFicheroPermisos {
{
// creating a file instance
File file1 = new File("C:\\Users\\kevin\\Documents\\workspace-spring-tool-suite-4-4.16.0.RELEASE\\CreoFicheroWindows.txt");
File file2 = new File("C:\\Users\\kevin\\Documents\\workspace-spring-tool-suite-4-4.16.0.RELEASE\\CreoFicheroWindows2.txt");
// check if the file exists
boolean exists = file.exists();
boolean exists = file1.exists();
if(exists == true)
{
// printing the permissions associated with the file
System.out.println("Executable Readable Writable lastimewrite Lengh Name");
System.out.println("---------- --------- --------- ------------- ------ -----");
System.out.println(file1.canExecute() + " " + file1.canRead() + " " + file1.canWrite() +" "+ new Date(file1.lastModified())+ " "+ file1.length()+" "+ file1.getName());
System.out.println(file2.canExecute() + " " + file2.canRead() + " " + file2.canWrite() +" "+ new Date(file2.lastModified())+ " "+ file2.length()+" "+ file2.getName());
}
else
{


Loading…
Cancel
Save