updating a programs code prior to running

S

steve

Hi,

I have a program that started life as a simple application, I then added the
ability for version checking.

on OSX it was simple:
1. version check
2. download code updates with an extension ".new
3. rename the old program files ".old"
4. rename ".new" to current program.


the interesting thing was that on OSX i could actually re-name the java .jar
files i was running from inside the java file.

but on windows It broke with " file in use"

(quite why & how OSX allows files in use to be renamed is another matter)

so i ended up writing a small loader class that did the downloading prior to
launching the "dynamic" app

the question is how do other people update the loader app, if it needs
modification, or do all java apps suffer from this problem.

I.E eclipse for example.

thanks.

steve
 
A

Andrew Thompson

I have a program that started life as a simple application, I then added the
ability for version checking.

on OSX it was simple:
1. version check
2. download code updates with an extension ".new
3. rename the old program files ".old"
4. rename ".new" to current program.

On every OS with since Java 1.3.1 it is simpler..
<http://www.physci.org/codes/javafaq.jsp#jws>
 
M

Michael Borgwardt

steve said:
(quite why & how OSX allows files in use to be renamed is another matter)

Unix filesystems use the concept of an "inode", which contains all information
about a file (including the information necessary to access it) *except* its
name and path. Directories contain (for each file) the name and a pointer to
the inode. This allows a file to be renamed (only the directory entry is changed,
not the file itself) while applications that are using it are not disturbed
since they access it through the inode. It also allows the same physical file
to appear at two or more places in the filesystem tree in different directories
and/or under different names.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top