Hans,
many thanks.
I think that does work. My problem and the reason I am doing this (although a bit wacky!) is to create a servoy offline solution that is capable of updating itself!
On the Mac it work fine. I download the new sybase repository file using ftp, copy the .db into the database folder, delete the old log file and immediately close the solution.
On starting again, it creates a new log file and hey presto, I have just cracked the chestnut of providing updates using servoy for a servoy offline solution.
On good old Windows, none of the Java file functions, to delete or move files onto what is a read only sybase file in use, work.
So my aim her was to create a bat file that ran in the background with a 5 second pause that when the application quit would move the files and replace the servoy_repository file once sybase which closes on application shutdown released the lock!
- Code: Select all
@ping 127.0.0.1 -n 2 -w 1000 > nul
@ping 127.0.0.1 -n 10 -w 1000> nul
DEL /F database\servoy_repository.db
DEL /F database\servoy_repository.log
MOVE database\new\servoy_repository.db database\servoy_repository.db
This does the trick from the command line. The problem i think is that as soon as servoy closes it must stop the bat file running as it is the parent of the process. Or thats what i think.
Many moons ago in Perl, I would have switched the standard input from the requesting web browser! (crashed Demons servers in 1995 doing that when writing a robot the could function without my dial up connecting costing me a fortune.)
So I challenge any windows servoy techies out there:
How can i force delete or move a file from java that will overwrite a windows read only file that is in use or
Is there anyway to sporn a .bat process that will continue after Servoy shuts down until complete. The reason I need a few seconds is for Sybase to close and release the servoy_repository files from being in use.
Many thanks for any suggestions
David