Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

InitDir / DirList

Greetings!
Using OI 9.1.1
I have an InitDir/DirList issue.
This code works fine when run from the system monitor:

compile Subroutine initdir_test(dummy)
nl= char(13):char(10)
fnpath = "\\marvel\mediafiles\video\3\*.jpg"
initdir fnpath
allfiles = dirlist()
allfiles1 = allfiles
Swap @fm With nl In allfiles1
OSWrite "allfiles1: ":allfiles1 On "c:\1temp\initdir_test1.txt"
return

(allfiles1 contains all the .jpg files in the folder.
As verified by initdir_test1.txt.)


However, when the same routine is called from a subroutine which is called by oecgi3,
it does not work as expected. ( allfiles1 is empty)

I'm out of ideas....

Have fun,
Paxton

Comments

  • I can't explain why this happens, but it appears that UNC file paths are not supported when the engine is running within the context of OECGI3. Probably for security reasons. Perhaps others with web server administration experience can speak more expertly on this subject. You can, in the meantime, test my theory by mapping "\\marvel\" to a drive letter and seeing if using that instead fixes the issue.
  • Good Idea. I had tried that before I got the permissions to the network drive set up correctly, and before I wrote the test code....
  • If you are going to test this theory then make sure you run the OEngineServer from a command prompt (i.e., debug mode). When you run it as a Service then it won't have access to mapped drives.

    When I get a moment I'll test this out on my web server development environment.
  • Thank you guys for your attention. My production environment has these data on a drive in the web server machine, no no problem. On my development, I was just avoiding making up some local test data and was linking to some on another machine. So, no real issue, Thanks again for the thoughts.
    Paxton
Sign In or Register to comment.