|
|
@ -0,0 +1,37 @@ |
|
|
|
package mkdir1; |
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
|
|
|
|
public class main { |
|
|
|
public static void main(String args[]) { |
|
|
|
File direct = new File("."); |
|
|
|
String[] lista = direct.list(); |
|
|
|
|
|
|
|
File arch; |
|
|
|
for(int i = 0; i < lista.length; i++) { |
|
|
|
arch = new File(lista[i]); |
|
|
|
System.out.print(lista[i]); |
|
|
|
System.out.print(" "); |
|
|
|
if(arch.isDirectory()) |
|
|
|
System.out.print("directorio"); |
|
|
|
else |
|
|
|
System.out.print("archivo"); |
|
|
|
System.out.print(" "); |
|
|
|
if(arch.canExecute()) |
|
|
|
System.out.print("ejecutable"); |
|
|
|
else |
|
|
|
System.out.print("no_ejecutable"); |
|
|
|
System.out.print(" "); |
|
|
|
if(arch.canRead()) |
|
|
|
System.out.print("lectura"); |
|
|
|
else |
|
|
|
System.out.print("no lectura"); |
|
|
|
System.out.print(" "); |
|
|
|
if(arch.canWrite()) |
|
|
|
System.out.println("escritura"); |
|
|
|
else |
|
|
|
System.out.println("no escritura"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |