Search code examples
javajrubyibm-midrangejt400ibm-ifs

Issues writing text file to IFS though jt400


All I'm trying to do is to drop a log on IFS

Here is my code:

  def write(target_filename, data)
    stream = com.ibm.as400.access.IFSFileOutputStream.new(AS400.sys, target_filename)
    stream.write(data.to_java_bytes)
    stream.flush
    stream.close
  end

When i read it though the jt400 library, it comes out ok.

But when i go thought the qShell or wrklnk the file seems empty.

Any ideas why? Is it the CCID?


Solution

  • Found the issue. I was using IFSFileOutputStream to write binary stream of text. By switching it to IFSTextFileOutputStream, problem was resolved.