Article View: borland.public.jbuilder.java.language
Article #8321Re: Unique file name
From: Paul Linehan
Date: Fri, 30 Mar 2001 14:22
Date: Fri, 30 Mar 2001 14:22
40 lines
2078 bytes
2078 bytes
"se wen" <se_wen@nightmail> wrote:
> Hi Joi Ellis,
> Thanks for your response. I think I need to explain a little more in what I
> am attempting to accomplish.
> My project currently creates a chart image and stores it in a directory (see
> code) with a specified file name "chart.PNG".
>
> .................................................................
> JCEncodeComponent.encode(JCEncodeComponent.PNG, SESChart.snapshot(), new
> File("c:/Windows/jbproject/untitled8/src/untitled8/chart.PNG"));
> .................................................................
>
> However, since there will be multiple users and threads at the same time
> accessing the chart method we need some method that can scan the name of the
> files in the directory (for the above example it would be 'untitled8') then
> assign a new name that does not already exist in that directory. This name
> would need to be able to be stored as a variable so that it can be passed to
> the above encoding method.
> Thanks again for your suggestions
Sounds like you need a database of some sort to return you a unique id
- though of course that brings its own overhead.
You could do something based on time to the millisecond?
Paul...
> Stuart
Technical Details
Message-ID:
<3ac49667.262317392@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone2.usenetserver.com!news-out.usenetserver.com!feed2.onemain.com!feed1.onemain.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!193.120.178.201References:
<3ac3a412$1_1@dnews> <3ac3a833_1@dnews> <3ac3b766$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,a9c867af487cce47 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-03-30 06:56:07 PST From: paul@esat.net (Paul Linehan) Newsgroups: borland.public.jbuilder.java.language Subject: Re: Unique file name Date: Fri, 30 Mar 2001 14:22:47 GMT Message-ID: <3ac49667.262317392@newsgroups.borland.com> References: <3ac3a412$1_1@dnews> <3ac3a833_1@dnews> <3ac3b766$1_1@dnews> X-Newsreader: Forte Free Agent 1.21/32.243 NNTP-Posting-Host: 193.120.178.201 X-Trace: 30 Mar 2001 06:21:40 -0800, 193.120.178.201 Lines: 41 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone2.usenetserver.com!news-out.usenetserver.com!feed2.onemain.com!feed1.onemain.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!193.120.178.201