MIDRANGE dot COM Mailing List Archive



Home » JAVA400-L » October 2005

IFSFileWriter problem: unusual output in IFS file



fixed

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






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact