OS-DIR for shared network folder

Jim Ford

New Member
I have the following code that reads a directory on my IIS webserver and places the files in the directory in a temp file. I need to get a list of actual documents in the directory so that I can create links to the documents on my web page created by webspeed.

This works as long as am placing the documents in a directory on my webserver. However, the actual docments are located on a network file server. My understanding is that instead of using a drive letter (C: drive) I need to use the UNC path because IIS is a service and drive letters are not available to it. The UNC path for the network directory is "\\favstor01\fs01\JobDocs\Documents". What syntax would I use in place of the INPUT FROM OS-DIR ("C:\documents")?

The code below works:

Def var x as char.

INPUT FROM OS-DIR ("C:\documents").
REPEAT:
SET x.
CREATE wf. */ this is a temp file I have already defined */
ASSIGN wf_filename = X.
END.
INPUT CLOSE.

{&OUT} "<TABLE>".
FOR EACH wf:
{&OUT} "<TR><TD>" wf_filename "</TD></TR>".
END.
{&OUT} "</TABLE>".


The code below does not work:

INPUT FROM OS-DIR ("http://www.domain-name.com/drawings/").
REPEAT:
SET x.
CREATE wf. */ this is a temp file I have defined */
ASSIGN wf_filename = X.
END.
INPUT CLOSE.

{&OUT} "<TABLE>".
FOR EACH wf:
{&OUT} "<TR><TD>" wf_filename "</TD></TR>".
END.
{&OUT} "</TABLE>".


I can see that "INPUT FROM OS-DIR" should not work, but I do not know what to put in its place.

Jim
 

4GLNewbie

Member
In my opinion yuo'll have to connect a logical unit on the pc that runs your program in windows. And then you'll have a unit like Z: where to look for your files.

Other way to proceed is create a ftp site where your files are and then use a simple batch file to retrieve the files from your source and put them in "C:\Documents". You may execute your batch file using Planified Operations from windows i suppose.

Hoping i am been helpful.
 

TomBascom

Curmudgeon
Maybe I just don't get this whole "windows" thing but... it seems to me that when you say:

I need to use the UNC path because IIS is a service and drive letters are not available to it. The UNC path for the network directory is "\\favstor01\fs01\JobDocs\Documents".

and then code:

Code:
INPUT FROM OS-DIR ("http://www.domain-name.com/drawings/").

That the expected result would be:
The code below does not work:

and that perhaps you should try:

Code:
INPUT FROM OS-DIR ("\\favstor01\fs01\JobDocs\Documents").

or:

Code:
INPUT FROM OS-DIR ("~\~\favstor01~\fs01~\JobDocs~\Documents").

(I'd use ~\ because I'm a UNIX guy and a naked \ makes me nervous.)
 

TomBascom

Curmudgeon
Darned if I know. If that's is what the windows-gibberish about "UNC" means then I suppose so. I'm just observing that the original post says that he needs to use that path name. But didn't. So I'm proposing that maybe he ought to try using the path name that he says he is supposed to be using.

Personally I'd apply the Linux patch to this server and start running a reliable web server like Apache. But I'm sure that's just me being cranky in the morning ;)
 

Jim Ford

New Member
All, I have been told that the "input from os-dir" command will work for a drive letter (C:\path\document) and for a network resource using the UNC name (http://[URL="http://www.name.com"]www.name.com/path/document[/URL]). In order for the network resource to be available to Webspeed the WebSpeed broker wsbroker1 owner must have a system user that has permissions to the network resource. I am working on this now and will let you know what happens.

Jim
 

TomBascom

Curmudgeon
Ok. But I think you're confused about the difference between UNC and URL.

Above when you 1st said UNC you gave "\\favstor01\fs01\JobDocs\Documents" as the file name. And that looks like a UNC to me -- it starts with "\\".

But in your code that doesn't work, and in the latest post, you are specifying a URL, "http://www.name.com/path/document", not a UNC.

URL and UNC names are not interchangeable.

You've given a UNC name that you say would work. But the posted code didn't use it. Did you try it and just not tell us about it? Or does it turn out that the given UNC doesn't work? Or is the issue that you need to be able to use arbitrary paths that might also be URLs?
 

Jim Ford

New Member
Sorry, I may have gotten the "/" in the wrong direction in my post. I do understand the difference. Thanks for pointing that out. It is the UNC that does not work at this time. I am still working on getting the Webspeed broker user established with the proper permissions. Jim
 

4GLNewbie

Member
I still suggest you to find a way to make visible the folder to your pc. Just to have accessing rights and other things in separated points.

Is it accessible from your web browser or explorer ?

I guess now you have understood the possibile solutions ( may be not all of them ) and can manage to get out of the trouble.

Good luck!
 

TomBascom

Curmudgeon
Sorry, I may have gotten the "/" in the wrong direction in my post. I do understand the difference. Thanks for pointing that out. It is the UNC that does not work at this time. I am still working on getting the Webspeed broker user established with the proper permissions. Jim

UNC vs URL is not a matter of "\" vs "/". Both forms are UNCs.

The code that you posted shows you using "http:". URLs are used for fetching web pages. That is not meaningful to OS-DIR.
 

4GLNewbie

Member
Last thing, i forgot!

If the target is [http://something] you will have probably to use a ftp site.
Create it on the web server ( protecet it with at least one user and password !).
Then write a batch file to access and obtain files you need from it, that puts files in your pc directory.

Don't know if you can manage the whole thing in your code, instead..

Bye!
 
Top