tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brian janaszek <...@anklebiter.net>
Subject Maybe OT: File Locking and Tomcat
Date Mon, 14 Apr 2003 08:44:23 GMT
Hello--

This may be a bit offtopic but....

I'm implementing a web app using Tomcat 4.1 running on linus with JDK
1.3 and currently my client doesn't want to use a database to store
data.  Therefore, I'm stuck writing some data to a CSV file that they
can then import into Excel.  I'm curious if there's a way to easily
implement some sort of file locking so there aren't access issues for
the CSV.  I've seen the new Java IO API (with FileChannel and whatnot),
but like I said, I'm stuck with the JDK 1.3 for the moment.

A potential solution I'm looking into involves checking for a lock file
(like my-file.csv.lock).  If it doesn't exist, I create it, then write
to the CSV, otherwise, I wait til the lock file doesn't exist.

Any other ideas?

Thanks
brian


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message