| Eclipse IDE Javadoc Tooltips |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- visit http://www.real-article.com/java/index.phpThe www.real-article.com website provides a ton of information about
java. In addition, you will find extensive information on leading java
to help you on your way to success.
Please have a look at our java articles, products, resources, and
additional information located throughout www.real-article.com.
We strive to provide only quality articles, so if there is a specific
topic related to java that you would like us to cover, please contact
us at any time.
visit http://www.real-article.com/java/index.php
- 1
- finding text in formatted JTextPane by using scannerHello I'm trying to create a program, which reads text from a text
file, by using a scanner, finds definitions for particular phrases,
depending on a rule list and stores the data in a list, by using
objects. For example, there is a rule list with the rules : is
/sentence, means /sentence, is referred to /sentence. If the user
insert the term Hypertension, then there will be a search on the
textfile by using the scanner, find the sentences that contain the
expressions from the rulelist and store them in objects ( Hypertension
is referred to blah blah blah). Each time I create an object, I store
to it the index where the sentence starts and where the sentence ends..
Now the hard part. I display the data in a jlist. They are of the form:
sentencestart, sentenceend,sentence. I need when a user clicks on an
object of this list, a JPane window to popup with the original text
(formatted) and highlight the sentence. The problem that I have is that
while I am using scanner to retrieve the words, it doesn't count the
line return character. So each time I save the place the sentence
starts and ends, it doesn't take in consideration the line return
characters. That leads the program to highlight wrong characters in the
JTextPane.
Is there any way, when I use the scanner, each time it finds a line
break or return character to take it in consideration?
Thank you... :)
- 2
- directly assigning to a field (was Java without OO)Isaac Gouy wrote:
>As-far-as-you're-concerned is OO completely defined by Smalltalk practices?
>
>If that's the case then please just write "Smalltalk OO" instead of "OO"
>
Hmm. The point of reading the references might not be to learn
Smalltalk, but to get a different perspective. After having used
Objective-C, C++, Python, and Java (not in that order) I think the
perspective of reading/using other languages is important. It
influences the programmer, and even suggests there may be better
languages to solve problems in than the ones they already use.
I don't think most Java programmers' investment in Java is so frail that
reading a Smalltalk book would shatter their world view. Perhaps it
would simply give them another perspective on their own class designs.
Same reason some people read editorals from multiple political viewpoints.
--
.tom
remove email address' dashes for replies
opensource middleware at <http://isectd.sourceforge.net>
http://gagne.homedns.org
- 2
- J2ME . How do I start?Hello,
I need to write an application for MIDP 2.0 phones. Once I write the
application, will it work on every phone that supports MIDP 2.0? What is
the best way to get started? Which tools should I use? Any online tutorial
videos or good books? Thanks a lot.
T.I.
- 3
- Converting byte array to stringHi,
I am trying to convert a byte array to a string. I am using the
possible ways
but not getting the result.
DatagramPacket dgram = new DatagramPacket(buf, buf.length);
ByteArrayInputStream byteIn = new ByteArrayInputStream (dgram.getData
(), 0, dgram.getLength ());
ObjectInputStream oin = new ObjectInputStream(byteIn);
Object obj = oin.readObject();
String recvString = obj.toString();
DataInputStream dataIn = new DataInputStream (byteIn);
String recvString = dataIn.readLine();
String recvString = new String(dgram.getData(),0,dgram.getLength());
String recvString = dataIn.readLine();
I am trying all these to convert my byte array to a string
But I am getting exception as invalid header.
Can anybody please suggest me.
Regards,
Hari.
- 4
- stability problems under eclipse on amd64 platform
I would like the following patch file to be tested and committed to the
java/jdk15 port until patch 6 is released on FreeBSD. This patch has
eliminated crashes for me and has made a significant difference in the
stability of eclipse.
Cheers,
Sean
- 4
- Web Services Performance problemI am trying to use web services in our project in websphere server, In
this we are using swing as client to connect the EJB, which is running
thru web services. we are able to connect EJB and get the response
from websphere server using web services. The below code is in EJB as
business method
public Vector getData(){
Vector v = new Vector();
for(int i=0;i<20000;i++)
v.add("String");
return v;
}
I use SOAP RPC encoding and in the client side i use SOAP.jar to
connect the web service and get the response.
but it takes around 8 seconds to get the response.
at the same time, i used below code in EJB as business method
public Vector getData(){
Vector v = new Vector();
for(int i=0;i<20000;i++)
v.add(new DataObject("String"));
return v;
}
public class DataObject{
String str = null;
public DataObject(String data){
str = data;
}
public String getData(){
return str;
}
public void setData(String data){
this.data = data;
}
}
here, i create object for my own DataObject class.
now i connect to this EJB, it takes double the amount of time to get
the response.
Please help me, Is there any other way to increase the performance of
web services?
Thanks,
Raja
- 4
- Java help websiteI am very new for Java programming, and I am looking for some Java help
website with a lot of examples and explan, anyone can help
- 4
- java access to USB MAC OS XI have a simple requirement at this point an Apple MAC OS X - that is
to detect the presence or lack of a USB device from java.
I have read about JSR 80, javax.usb, jUSB and all indicate not
available in Mac OS X.
I also know that in linux, I can do a "cat /proc/bus/usb/devices" and
get a list of devices connected to the machine.
Now Mac OS X is "linux" - yet there doesn't appear to be /proc/dev/...
etc.
Any suggestions on how to get the presence or lack of a USB device
from java on Mac OS X??
- 4
- help me finding pathHi,
How to find the Path String from jrePath to jawtPath?
Thanks,
Sri
--
Message posted via http://www.javakb.com
- 11
- YourKit Java Profiler 2.1 Beta 2 ReleasedChanges in build 304:
- IDE integration: Eclipse is supported under Linux
- New agent parameter 'onexit' allows to automatically capture
snapshots on profiled application exit. See bundled documentation for
details.
- New agent parameter 'debugcompat' added as a workaround for JVM bug
that causes hangup of profiled application launched in remote debug
mode (happens, for example, when Debug is used in IntelliJ IDEA 4.x).
See bundled documentation for details.
- Percents as well as absolute values are shown in CPU and memory
views
- IDE integration: navigation to source code is supported for Eclipse
(if you have previous build installed, please run 'Tools | Integrate
with IDE...' again to install the new plugin)
The list of all improvements and features planned for 2.1 can be found
at
http://www.yourkit.com/preview/index.jsp
We welcome your feedback at email***@***.com
Best regards,
YourKit Team
- 11
- which vs thatI am writing documentation, and I dawned on me that I don't know the
difference between "which" and "that". I have a vague intuition which
to use, but there is no logic behind it.
In fact I don't think I could define the difference between
what, which and that.
I suspect "which" has to do with picking one from a small set, where
"that" provides an algorithm for inclusion.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 12
- resolving class loaderHi,
I'm working in an environment with many class loaders. A code in some
class, creates a data for me to persist. In order to read it back, I
must find the right class loader to use. In a simple scenario, if all
the data came from one jar, I could just keep the url to that jar. But,
if the data comes from various jars (say the class loader is a war
class loader, so it has reference to 3rd party libraries), then how can
I resolve it when loading the data? Meaning, what keys do I need to
persist so that I can find the same class loader when reading the data?
Thanx,
Ittay
- 12
- Java 1.5 and system fontsHi,
I don't know if this is the right group to ask this (if not, where
should I post?), but here we go: I have two machines, both running
Debian, and installed the official Sun JDK (1.5.0_05) on both. Here's
the question: on one machine, Java applications find all fonts that
have been installed on the system; on the other, Java applications only
find a very small set of standard fonts.
Obviously, there must a difference between the two systems (they are
certainly not identical, although they are pretty similar) -- but I
can't think what it could be. It is certainly not a configuration in
the JDK itself, because the two installations on both machines are
identical (I even diff-ed both directories to be sure :-) What I don't
know is how to make fonts available to the JVM - or, what I have done
wrong/correct on either machine. I know the fonts have been installed,
because running Gimp (for instance) on either machine finds all the
fonts. The fontconfig configuration in /etc/fonts is also identifical
as far as I can see (I don't know if that has anything to do with
anything, but I checked anyway :) Also, both systems are running defoma
(the Debian font manager), but I don't know if that can help in any way
here.
Any pointers or hints would be appreciated,
Thanks,
Edsko
- 15
- Using Using EventListenerList for non gui object listeningI have a non gui object that i would like to make available for
listeners but instead of using collection/list i am using the class
javax.swing.event.EventListenerList to hold my listeners.
I understand that if it's non gui then i should not involve gui classes.
However, is this acceptable?
|
| Author |
Message |
haldara

|
Posted: 2004-6-30 18:41:00 |
Top |
java-programmer, Eclipse IDE Javadoc Tooltips
Hi:
I'm using the Eclipse IDE for Java development, but am running into
some problems with the "Content\Code Assist" feature. Normally, when I
partially enter the name of a particular class of package, the IDE
automatically displays possible completions based on that string of
text. However, the IDE is also supposed to show me the associated
Javadoc for that class.
I know that this feature is enabled because it is able to show me the
associated Javadocs for any classes that I write myself and reside in
the current project.
I have set the Javadoc location for that project to the following
directory (gotten after unzipping the documentation download file):
file:/E:/Java API/docs/api/
However, it does not show any Javadocs for the other classes that are
in the Java API.
Can anyone help out?
Thanks,
- ADH
|
| |
|
| |
 |
Christopher Fuhrman

|
Posted: 2004-7-5 19:54:00 |
Top |
java-programmer >> Eclipse IDE Javadoc Tooltips
"ADH" <email***@***.com> wrote in message
news:email***@***.com...
> I know that this feature is enabled because it is able to show me the
> associated Javadocs for any classes that I write myself and reside in
> the current project.
[...]
> However, it does not show any Javadocs for the other classes that are
> in the Java API.
I used to have this problem. Now I pass the following on the startup command
in my shortcut to launch Eclipse:
-vm C:\j2sdk1.4.2_04\jre\bin\javaw
Of course, you should change the path depending on your installation of the
SDK. If the JRE thats used upon launching Eclipse doesn't contain the
javadoc, you won't see it. This happens usually because the standard
installation of a JRE is different from the SDK -- Eclipse sometimes finds
the wrong one. In my case that's due to the numerous installations and
upgrades, etc. Multiple JREs are often installed on a system. For example
Oracle installs a JRE. By being explicit on the launch, you take away all
doubt. Hope this helps!
Also, I specify my project path (which is outside of the Eclipse install)
with the -data option (in the same Eclipse launch shortcut). This helps
because you don't have to copy your data files EACH time there's a new
release. Helps for backing up the right files, etc. Indeed -vm and -data are
very useful items.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Execute JSP within a servlet ?Hi folks,
A bug in cocoon prevents me from using it with JSP ... so I decided to
do my own implementation. I want to load up and execute a JSP file from
within a servlet, and from the generated XML doc apply an XSL style
sheet, then send back HTML to the browser. This is doable right ? since
a jsp doc somehow gets compiled and executed within a servlet anyway
... Is there an example of how this can be done ?
Also, am I going to miss out on some possible caching that happens
magically when I invoke a jsp directly from the browser ?
Many thanks,
galpi
- 2
- load JNI from resource file?I am able to write a C native interface and load it using the
System.loadLibrary() routine.
Is there anyway to store the native interface library (say
"hello.dll") into a jar and then load the file from the jar?
- 3
- native jdk release schedule questionHi folks,
I am trying to find any information regarding the release schedules of
native java1.4 in binary form. As far as I understand the license allows for
a binary distribution. On the freebsd site latest news regarding java is
from December 2003. How do things look like? Or my question makes no sense
at all?
Cheers, Dani
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 4
- Set Txd always UPHello,
I use Java Comm, and i would like to know if i can use Txd (or td)
like RTS or DTR with Java Comm and how could I do this?
sample setTxd( true) and Txd=12v
setTxd( false) and Txd=-12v
- 5
- Interfaces vs. Abstract.Greetings,
I have googled around a bit about this one and consulted my various Java
tomes on the differences between abstract classes and interfaces.
They seem to be similar ideas *_BUT_* interfaces have no method code (i.e.
only abstract methods), just signatures and final static identifiers.
Abstract classes can have method code as well a abstract methods, constants
and non-constants.
It is possible for a class to implement multiple interfaces (in C++ talk
inherit from multiple abstract base classes) but a class can only extend
one other class (again in C++ese inherit from one class).
Is this understanding correct?
What general guidelines do you use to determine when to use an interface vs.
abstract classes?
For example I am working on creating a ReportWriter. I want the ReportWriter
to be able to write out in PostScript, text, and in HTML. I am thinking
about using an interface.
All three need to create headers, footers, and write detail lines. However,
the details of each operation are completely different from the other.
Thanks
--
From: Mark A Framness <email***@***.com>
http: http://netnet.net/~farmer/index.html
With all of thy getting, get understanding!
Proverbs 4:7
- 6
- Modify image and save to fileI want to read a .png image from a file, replace a color with a new color,
and write it back to a .png file.
I've managed to read the file into a BufferedImage. I've got a PixelGrabber
to look at the pixels, identify those of the old color, and replace them
with the new color, leaving me with an int[] of the pixels I want.
How do I modify write the modified pixels out to a .png file? I don't care
if I overwrite the original image or write to a new one.
No matter how I try to do it I end up with a new file that is identical to
the original, even though I can tell my code is correctly identifying the
pixels I want to change.
Please help,
Tim
- 7
- Data entry applicationHi,
I am an intermediate computer science student and I am in need of a "macro
type" tool/language that will let me automate a data entry process. The
data entry is rather simple but requires connecting to a server in between
data inputs, which ends up taking a lot of time per entry (about 10 minutes
per complete entry). On average, there are 50 - 100 entries to be made (10
min * 50 entries = one hell of a boring day.) The data that is to be
entered is in Excel, and then I (or some other unlucky person) must enter
the data manually into a prompt/DOS-like program run in the Windows (2000)
environment.
Would you know of anything that could help? Is there a way to do something
like this with any language? What would be required to setup the automation
(in the Windows environment)? I am pondering if a simple Windows
application that replicates key-strokes and has a timer capability would do
the trick (although I doubt it would be able to read the spreadsheets)?
Please let me know if you have any suggestions or comments. My thanks in
advance for any help.
email***@***.com
- 8
- question about DES APIHello All,
The following is the code I wrote to do DES encryption.
public byte[] run ()throws Exception
{
// TODO Auto-generated method stub
byte[] re = null;
byte[]re1 = null;
if (key.length != 8){
throw new DesException("Invalid Key!!!");
}
KeyGenerator kg = KeyGenerator.getInstance("DES");
SecretKey sk = kg.generateKey();
SecretKeySpec desKey = new SecretKeySpec(key, "DES");
Cipher des = Cipher.getInstance("DES");
if ((comm == Cipher.DECRYPT_MODE) && (data.length != 8)){
throw new DesException("Invalid Key!!!");
}
des.init(Cipher.ENCRYPT_MODE, desKey);
int l = des.getOutputSize(8);
re = des.doFinal(data);
des.init(Cipher.DECRYPT_MODE, desKey);
l = des.getOutputSize(16);
re1 = des.doFinal(re);
return re;
}
I don't understand why I try entrypt 8 bytes data, the the length of
return value is 16 bytes, the first 8 bytes are what I want, what are
last 8 bytes? as far as I know, for des, the input block is 8 bytes,
output block is 8 bytes too. I use this return value to decrypt, I got
correct value.
If I just input first 8bytes to decrypt I got exception.
Anyone can explain this to me or recommend any detail document about
these API?
Thanks a lot.
- 9
- Quick questionI am not sure if this is the group i should post this question so
maybe you can point me in the right direction.
I have a computer and when I install the java runtime environment it
installs but when i try to access a page that uses java the screen
freezes and some times turnes scrambles with blue colors. I have
never seen anything like this. The OS works fine otherwise. I have
tryed to uninstall and reinstall. The web site I go to needs it and
if you don't have it installed it begins an installation for you.
Thanks for any help you can give me
Ben Dunning
- 10
- Java ArchitectDoes this forum have an experienced Java Architect? I would like to
bounce a few questions to someone with some industry experience. I am
the project manager for a new software app. I would like some advice on
java architecture and technologies. Appreciate this is all high-level,
but if certain technologies jump out to you then please let me know.
Scenario: Message brokering of news items over a LAN
User view is a java applet or could be java enabled web page (some kind
of smart console running on their PC desktop)
For now the application will have 50 users all on the same internal
network.
Central Oracle/SQL Server Repository - holding messages.
All clients communicate with central database that holds messages and
configuration information.
Based on the config. found each java client will dynamically build drag
and drop lists/trees of this information.
Ability to screen capture based on a user selection and upload the
image to a DB repository
Each client will be able to post new messages to the server which will
need to alert the other clients.
An author of a message can see if messages have been read by the
consumers. If the user has not read the author can send a warning to
that particular user.
Licensing needs to be built in to restrict to 50 concurrent users.
Security login screens are required. Use central db server to
authenticate.
Scenario2: This is where it gets interesting. How would this change in
a WAN scenario? - Could this even work using zero front print java?
Also if you live in/near London then please let me know.
Andy
- 11
- Just upgraded to the newest jdk 1.5I just upgraded my jdk 1.5 to the newest version in ports after I saw a
commit fixing a performance issue.
My swing application now behaves very well without being sluggish at all
and looks much nicer than with jdk 1.4.
Thank you very much for your great work on this.
--
Christian Laursen
- 12
- Screen Fonts in SwingHello everybody;
Is there a way to access screen fonts (Fixedsys, Courier, Terminal ...)
on a windows machine using java swing. I tried the following. . .
GriphicsEnvironment.getAvailableFontFamilyNames()
but it does not return screen font names. I also tried
Font fn=new Font("Courier",Font.PLAIN,10)
But it returns 'Courier New' font instead of 'Courier'.
- 13
- comp.lang.java.{help,programmer} - what they're for (mini-FAQ 2004-10-08)Last-Modified: Fri Oct 8 11:38:42 2004 by David Alex Lamb
Archive-name: computer-lang/java/help/minifaq
Posting-Frequency: every 4 days
Before posting read Jon Skeet's "How to get answers on the comp.lang.java.*
newsgroups" at http://www.pobox.com/~skeet/java/newsgroups.html
Java FAQs and advice:
- Java FAQ (Andrew Thompson) http://www.physci.org/codes/javafaq.jsp
including his list of other FAQs http://www.physci.org/codes/javafaq.jsp#faq
- Java/Javascript/Powerbuilder HOWTO (Real Gagnon)
http://www.rgagnon.com/howto.html
- Java Glossary (Roedy Green) http://www.mindprod.com/jgloss.html
- jGuru jFAQs (John Zukowski) http://www.jguru.com/jguru/faq/
- Focus on Java (John Zukowski) http://java.about.com/
- Java Q&A (David Reilly) http://www.davidreilly.com/jcb/faq/
- Java GUI FAQ (Thomas Weidenfeller) http://www.physci.org/guifaq.jsp
comp.lang.java.help Set-up problems, catch-all first aid.
According to its charter, this unmoderated group is for immediate help
on any Java problem, especially when the source of the difficulty is
hard to pin down in terms of topics treated on other groups.
This is the appropriate group for end-users, programmers and
administrators who are having difficulty installing a system capable of
running Java applets or programs. It is also the right group for
people trying to check their understanding of something in the
language, or to troubleshoot something simple.
comp.lang.java.programmer Programming in the Java language.
An unmoderated group for discussion of Java as a programming language.
Specific example topics may include:
o types, classes, interfaces, and other language concepts
o the syntax and grammar of Java
o threaded programming in Java - sychronisation, monitors, etc.
o possible language extensions (as opposed to API extensions).
The original charter said that discussion explicitly should not include
API features that are not built into the Java language and gave examples
like networking and the AWT. These days AWT belongs in clj.gui, and
networking (and many other APIs) are often discussed in clj.programmer.
Do not post binary classfiles or long source listings on any of these
groups. Instead, the post should reference a WWW or FTP site (short source
snippets to demonstrate a particular point or problem are fine). For some
problems you might consider posting a SSCCE (Short, Self Contained, Correct
(Compilable), Example); see http://www.physci.org/codes/sscce.jsp
Don't post on topics that have their own groups, such as:
comp.lang.java.3d The Java 3D API
comp.lang.java.advocacy Arguments about X versus Y, for various Java X and Y
comp.lang.java.beans JavaBeans and similar component frameworks
comp.lang.java.corba Common Object Request Broker Architecture and Java
comp.lang.java.databases Using databases from Java
comp.lang.java.gui Java graphical user interface design and construction
comp.lang.java.machine Java virtual machines, like JVM and KVM
comp.lang.java.security Using Java securely
comp.lang.java.softwaretools Tools for developing/maintaining Java programs
Don't cross-post between these groups and c.l.j.programmer or .help -- it just
wastes the time of people reading the general groups.
Don't post about JavaScript; it's a different language. See
comp.lang.javascript instead.
--
"Yo' ideas need to be thinked befo' they are say'd" - Ian Lamb, age 3.5
http://www.cs.queensu.ca/~dalamb/ qucis->cs to reply (it's a long story...)
- 14
- Brand Watches Fila Men's Matrice watch #FLA55302 Discount, Replica, FakeBrand Watches Fila Men's Matrice watch #FLA55302 Discount, Replica,
Fake
Browse our Fila Men's Matrice watch #FLA55302 replica watches, which
is sure the watch you are looking for at low price. There are more
high quality designer watch replicas for selection
Fila Men's Matrice watch #FLA55302 Link : http://www.watches-brand.com/Replica-Fila-8343.html
Brand : Fila ( http://www.watches-brand.com/Fila-Replica.html )
Model : Fila Men's Matrice watch #FLA55302
Description :
<p>Digital quartz movement, Sport watch, Regular timekeeping, 100 laps
memory, World time function, 8 schedules reminder, Chronograph 1/100,
Second - Alarm, Black polycarbonate case, Lime green polyurethane
selector buttons, Black polycarbonate case, Stainless steel caseback,
50 meters/165 feet water resistant</p>
Sale Price : $ 210.00
Fila Men's Matrice watch #FLA55302 Details :
<ul>
<li>Brand: Fila</li>
<li>Dial color: Black polycarbonate case, Digital dial (253 dot m</li>
</ul>
Fila Men's Matrice watch #FLA55302 is new brand replica, join
thousands of satisfied customers and buy your Fila with total
satisfaction. A watches-brand.COM 30 Day Money Back Guarantee is
included with every Fila Replica Series for secure, risk-free online
shopping. watches-brand.COM does not charge sales tax for the Fake
Fila Men's Matrice watch #FLA55302.
All of our replica watches are shipped via EMS to worldwide. Normally
it takes 3days to prepare the fake watch you ordered and 5-10days to
transmit depending on the different destination.We pay for the free
shipping cost for total quantity over 20 pcs. The EMS tracking NO.
will be sent by email when an order is shipped from our warehouse. No
more other charges from watches-brand.com such as the tax. If you have
any other questions please check our other pages or feel free to email
us by email***@***.com.
The Same Replica Fila Watches Series :
Fila Men's Metropolis watch #21204 :
http://www.watches-brand.com/Replica-Fila-8344.html
Fila Women's Metropolis watch #21206 :
http://www.watches-brand.com/Replica-Fila-8345.html
Fila Men's Polaris watch #FLA63273 :
http://www.watches-brand.com/Replica-Fila-8346.html
Fila Men's Polaris watch #FLA63298 :
http://www.watches-brand.com/Replica-Fila-8347.html
Fila Women's Posh watch #31407 :
http://www.watches-brand.com/Replica-Fila-8348.html
Fila Men's Proteon watch #21803 :
http://www.watches-brand.com/Replica-Fila-8349.html
Fila Men's Proteon watch #21813 :
http://www.watches-brand.com/Replica-Fila-8350.html
Fila Men's Synthesis watch #31304 :
http://www.watches-brand.com/Replica-Fila-8351.html
Fila Men's Synthesis watch #31308 :
http://www.watches-brand.com/Replica-Fila-8352.html
Fila Women's The Bits watch #21601 :
http://www.watches-brand.com/Replica-Fila-8353.html
Brand Watches Fila Men's Matrice watch #FLA55302 Discount, Replica,
Fake
- 15
- crash during file writing, how to recover ?Hi
I'm writing a commercial program which must be reliable. It has to do
some basic reading and writing to and from files on the hard disk,
and also to a floppy.
I have foreseen a potential problem. The program may crash
unexpectedly while writing to the file. If so, my program should
detect this during startup, and then (during startup) probably delete the
data added to the file and redo the writing operation.
Are file writing operations atomic ? ie when you write to a file,
will it either do it succesfully, OR say half fail (eg write a few letters
and not finish), OR not commit any changes to the file if a crash at
this point occurs?
My next question is how is this handled in commercial programming? I
plan on writing a flag (say, a simple char) to another file (this
would signal that a file write is about to begin), and then
removing this char after the file writing operation is completed.
Then on startup i just check the flags. if flag hasn't been removed a
crash occurred, so have to open file and get rid of any garbage.
Has anyone done anything similar b4? if so how did you handle this
crash scenario. My application could totally stuff up if i don't
handle this right.
by the way, i'm using the java language and api. this might effect
how files are written to, so i thought i should mention this.
MANY THANKS
Joseph
|
|
|