|
// Work with /Dir/File.txt on the system flash. AS400 as400 = new AS400("flash"); IFSJavaFile file = new IFSJavaFile(as400, "/Dir/File.txt"); // Determine the parent directory of the file. String directory = file.getParent(); // Determine the name of the file. String name = file.getName(); // Determine the file size. long length = file.length(); // Determine when the file was last modified. Date date = new Date(file.lastModified()); // Delete the file. if (file.delete() == false) { // Display the error code. System.err.println("Unable to delete file."); } try { IFSFileOutputStream os = new IFSFileOutputStream(file.getSystem(), file, IFSFileOutputStream.SHARE_ALL, false); byte[] data = new byte[256]; int i = 0; for (; i < data.length; i++) { data[i] = (byte) i; os.write(data[i]); } os.close(); } catch (Exception e) { System.err.println ("Exception: " + e.getMessage()); }![]()
[ Legal | AS/400 Glossary ] |