Page 2 of 2

Re: Creating file in watch directory

Posted: Tue Mar 31, 2015 7:00 am
by Cliff Wiernik
That is the approach we generally use when we have control. Have program look for the tag file and then import the real file that was created first. No control over the program doing the watch. It does not care about file name, it looks for any file and then loads it.

Re: Creating file in watch directory

Posted: Tue Mar 31, 2015 7:08 am
by Cliff Wiernik
Our client uses the the Novell NCP protocol. Will look at your smb2 reference.

Re: Creating file in watch directory

Posted: Tue Mar 31, 2015 7:28 am
by skiman
it looks for any file and then loads it.
In that case it won't be easy to prevent an error.

If the directory where the file must be saved doesn't exist, will the watching program give an error? If not, you could rename the directory, put your file in it, en then restore the original name to the directory.

Re: Creating file in watch directory

Posted: Tue Mar 31, 2015 7:51 am
by Cliff Wiernik
Thanks for the thought,

Not really practical as the watch folder is used by many different individuals. Credit department, Collection Department, anyone who needs to request credit reports. They all expect it to be available at any time. Will monitor and change to using low level file functions instead of memowrit. At least they provide error reporting and you can control.

Re: Creating file in watch directory

Posted: Tue Mar 31, 2015 8:24 am
by skiman
I'm wondering why low level functions would resolve this problem. There will always be a moment that the file is created, but still empty. If the watch software reads that file at that particular millisecond, you will have the same problem.

Re: Creating file in watch directory

Posted: Tue Mar 31, 2015 8:40 am
by Auge_Ohr
if you have a lot of RAM : try a RAMDISK on Server which you can share like http://www.dataram.com/

Re: Creating file in watch directory

Posted: Tue Mar 31, 2015 9:10 am
by Cliff Wiernik
But was wierd was that the file never appeared to be created as it did not show up in the erased file process that Novell NSS system provides. If I can detect that, I could just retry the process. I see that memowrit does return a success/failure value. I will add a check for that. That may be sufficient.

Re: Creating file in watch directory

Posted: Tue Mar 31, 2015 10:40 am
by rdonnay
I haven't worked with Novell in a long time but this may work:

Create the file in a different folder on the Novell server, then MOVE the file to the watch folder.
In Windows a MOVE only changes an entry in the file allocation table so I see no scenario in which you would end up with an empty file.
I think that Novell has a MOVE that works the same way.

Re: Creating file in watch directory

Posted: Tue Mar 31, 2015 1:18 pm
by Cliff Wiernik
Novell OES (running on a SLES linux server) does support the move command from the workstation. I will just have to determine what API to use. I use the windows copy API's already but will have to search the needed information.