#915 SysFileSearch not returning hit

APIs (66)

I'm running OORexx Windows 32bit 4.0.1 (tried 4.0.0 too)
I have a haystack file with lots of strings in. At column 4226 of my file, I have:

E,56551210A 770 5

My code runs:
CALL SysFileSearch needle, data, stem
NEEDLE => "56551210A 770"
"56551210A 770"
DATA => "haystack.txt"

if stem.0=0
STEM.0 => "STEM.0"
STEM.0 => "0"
"=" => "1"

so it is not seeing the entry which is there.

If I 'grep' the file and check the rc, it works fine - but it much slower.
Is this a bug, or a restriction on line length?



  • Mark Miesfeld

    Mark Miesfeld - 2010-08-08

    If you would provide both the data file and an example program that demonstrates the problem, you are likely to get a developer to take a look at this.

    For example, this is the third time I've looked at it, but decided to skip it because I don't have the time to try and create a data file and test case from the little information you have provided. What does it mean "a lot of strings?" How long are strings? etc..

  • Mark Miesfeld

    Mark Miesfeld - 2010-08-12

    Fix bug title

  • Mark Miesfeld

    Mark Miesfeld - 2012-02-06

    Changing priority because the submitter has failed to provide an example program.

  • Rick McGuire

    Rick McGuire - 2013-11-22
    • Pending work items: --> none
    • Group: v4.0.1 --> None
    • Jerry Senowitz

      Jerry Senowitz - 2015-01-22

      Ran into this problem in 4.2.0 using Windows XP SP3 (32 bit). It appears that SysFileSearch will not find lines where the search argument is in columns greater than 4095 bytes. If the search argument is found in columns 1-4095? it will only return 4096 (with the "N" option) bytes of the line where a match was found even though the line is longer.

      Here is a self contained test to demonstrate the problem (nothing fancy):
      fn = "test"
      ln = ""
      do i=1 while length(ln) < 4096
      ln = ln i
      call SysFileDelete fn
      call lineout fn,ln
      call lineout fn
      rc = SysFileSearch(i-1,fn,"fl")
      if rc \= 0 then say "File Problem:" rc
      else say fl.1
      call SysFileDelete fn

      If you change the 4096 to 4090, it works fine!

      If you prefer, I can open up a new problem on this. Let me know.



Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks