Creating file in watch directory

This forum is for general support of Xbase++
Message
Author
Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Creating file in watch directory

#11 Post 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.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Creating file in watch directory

#12 Post by Cliff Wiernik »

Our client uses the the Novell NCP protocol. Will look at your smb2 reference.

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Creating file in watch directory

#13 Post 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.
Best regards,

Chris.
www.aboservice.be

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Creating file in watch directory

#14 Post 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.

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Creating file in watch directory

#15 Post 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.
Best regards,

Chris.
www.aboservice.be

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: Creating file in watch directory

#16 Post by Auge_Ohr »

if you have a lot of RAM : try a RAMDISK on Server which you can share like http://www.dataram.com/
greetings by OHR
Jimmy

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Creating file in watch directory

#17 Post 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.

User avatar
rdonnay
Site Admin
Posts: 4728
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Creating file in watch directory

#18 Post 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.
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Creating file in watch directory

#19 Post 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.

Post Reply