Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Print Files copied to IFS reading with Java

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Print Files copied to IFS reading with Java

    I've printed out some source files using option 6 and then used Navigator to copy them to the IFS drive. By default these files are named QPSUPRTFxxxxxx.TXT, and do not reflect the actual source name in the file name.

    My idea is to list all files in this directory with Java, open the file and substring out the source name, then rename the file. I will then have files with names that make sense. I'm able to retrieve a list of all file names, but am unable to read the files.

    I have used IFSRandomAccessFile, which I have used in the past to read text files from the IFS with no luck.

    IFSRandomAccessFile fileToRead = new IFSRandomAccessFile(targetSystem, serverDir + getfile,"rw",IFSRandomAccessFile.SHARE_ALL,IFSRandomAccessFile .OPEN_OR_CREATE);
    String readstring = fileToRead.readLine();


    In the code above readstring is null. The code above works with other text files just not spool files copied over to the IFS.

    I also tried using BufferedReader, it doesn't return a null but has lots of extra spaces and boxes inbetween the characters. Does anyone have any idea why these spool files converted into text files aren't readable? They open with textpad/note just like any other file.
Working...
X