We want to write text strings to a file in the IFS. We can write to the IFS
file, but each letter is separated what looks like a tab, and the end-of-line
characters are unusual.
Here's the exact code:
public static void main(String[] args) {
AS400 system = new AS400("mysystem", "myname", "mypassword");
IFSFile file = new IFSFile(system,
"/home/mydir/writeifs_test.txt");
try {
PrintWriter myWriter = new PrintWriter(new BufferedWriter(new
IFSFileWriter(file)));
myWriter.println("a new test");
myWriter.close();
} catch (Exception e) {
e.printStackTrace();
}//end-try-catch
}//end-main
The content of the writeifs_test.txt file in Notepad looks like this:
a n e w t e s t
There are also two special characters (boxes) at the end of the line that are
not showing up in this email message. When I open it in WordPad, I see a box
between each letter of "a new test."
It's not an issue of translation when moving the file from the IFS to my
desktop (via Navigator drag and drop), because I can move other text files from
the same IFS directory to my desktop with no problems.
Any help would be greatly appreciated.
Thanks,
Kelly