1

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?

mike
  • 1,233
  • 1
  • 15
  • 36
Ruslan
  • 1,919
  • 21
  • 42
  • 2
    `... the file seems empty.` Meaning what? You view attributes for the size? Or you run utilities to display content? Or...? What do you run? What happens? – user2338816 Feb 18 '17 at 01:29
  • 1
    IFSFileOutputStream stream = new IFSFileOutputStream(as400, "/Dir/File"); – danny117 Feb 20 '17 at 22:23

1 Answers1

1

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

Ruslan
  • 1,919
  • 21
  • 42