473,809 Members | 2,617 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Random Filenames

Amy
Does anyone know if thier is anything built in the framework to generate
random filenames?

I have a dataset(hash table) that grows very large. After a certain point a
good portion of the elements will not be used anymore until the end of the
program. In order to conserve memory I wanted to write out the current data
in the hash table to a file.

Any thoughts?
Amy
Nov 13 '05 #1
3 10409
Probably not the best way but in one application i did a while ago i
generated a GUID and used that & the current date/time as a file name.

"Greg Ewing [MVP]" <gewing@_NO_SPA M_claritycon.co m> wrote in message
news:eY******** ******@TK2MSFTN GP11.phx.gbl...
Amy, you could use a TempFileCollect ion to create files whose names are
'random'. You could also use the GetTempFileName method off of the Path
class in System.IO. A third option would be to wrap the win32 API
GetTempFileName (). Hope that gives you some ideas to do what you want.

--
Greg Ewing [MVP]
http://www.claritycon.com/

"Amy" <am**@paxemail. com> wrote in message
news:uk******** ******@TK2MSFTN GP10.phx.gbl...
Does anyone know if thier is anything built in the framework to generate
random filenames?

I have a dataset(hash table) that grows very large. After a certain point
a
good portion of the elements will not be used anymore until the end of

the program. In order to conserve memory I wanted to write out the current

data
in the hash table to a file.

Any thoughts?
Amy


Nov 13 '05 #2
Thanks!
Greetings, timtos.

"Artur Zakrzewski" <Ar************ *@hotmail.com> wrote in message
news:#c******** ******@TK2MSFTN GP10.phx.gbl...
Use System.Guid.New Guid() method to get a new GUID object.

Regards,

Artur

Użytkownik "timtos" <ha*****@uni-koblenz.de> napisał w wiadomo¶ci
news:be******** **@news.uni-koblenz.de...
How did you generate a GUID? I am using DateTime.Now.Ti cks as my "GUID" in
one of my applications. Ok for me but not very good :)
Greetings, timtos.

"Arran Pearce" <ar**********@b acoll.ac.uk> wrote in message
news:eH******** ******@TK2MSFTN GP10.phx.gbl...
Probably not the best way but in one application i did a while ago i
generated a GUID and used that & the current date/time as a file name.

"Greg Ewing [MVP]" <gewing@_NO_SPA M_claritycon.co m> wrote in message
news:eY******** ******@TK2MSFTN GP11.phx.gbl...
> Amy, you could use a TempFileCollect ion to create files whose names
are > 'random'. You could also use the GetTempFileName method off of the Path > class in System.IO. A third option would be to wrap the win32 API
> GetTempFileName (). Hope that gives you some ideas to do what you want. >
> --
> Greg Ewing [MVP]
> http://www.claritycon.com/
>
>
>
> "Amy" <am**@paxemail. com> wrote in message
> news:uk******** ******@TK2MSFTN GP10.phx.gbl...
> > Does anyone know if thier is anything built in the framework to

generate
> > random filenames?
> >
> > I have a dataset(hash table) that grows very large. After a certain point
> a
> > good portion of the elements will not be used anymore until the
end of the
> > program. In order to conserve memory I wanted to write out the

current
> data
> > in the hash table to a file.
> >
> > Any thoughts?
> > Amy
> >
> >
>
>



Nov 13 '05 #3
You could try Path.GetTempFil eName() under System.IO

"Returns a unique temporary file name and creates a zero-byte file by that
name on disk."

http://msdn.microsoft.com/library/de...l=/library/en-
us/cpref/html/frlrfsystemiopa thclassgettempf ilenametopic.as p

Cheers,
Simon.
Does anyone know if thier is anything built in the framework to
generate random filenames?

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2743
by: Oliver Spiesshofer | last post by:
Hi, how would I make a script that pics a random file from a tree? Is there something like this existing? I need one that can handle many files on a large tree. thanks Oliver
4
3418
by: kingofkolt | last post by:
I have a directory of images, called "random". In it are the following files: 1.gif 2.gif 3.gif 4.gif I use this script to choose a random image and display it:
7
1777
by: Robin Becker | last post by:
We've been queried about the randomness of some filenames we're producing. I worked through and seemed to satisfy myself that random is being initialised from the system time in C time(&now) init_genrand(self, (unsigned long)now); where now is a time expressed in integral seconds since the eopoch. This would mean that our filenames are not particularly random as that would make the sequences common if two cgi scripts started within a...
2
2734
by: Amy | last post by:
Does anyone know if thier is anything built in the framework to generate random filenames? I have a dataset(hash table) that grows very large. After a certain point a good portion of the elements will not be used anymore until the end of the program. In order to conserve memory I wanted to write out the current data in the hash table to a file. Any thoughts? Amy
9
12406
by: Michael Burtenshaw | last post by:
I would like to make a slide show using random images. The problem is my host is 250.com, and they don't support cgi-programs. Is there another way to accomplish random images?
2
8672
by: rbutch | last post by:
guys, i need a little help with this. this is working (well sort of) i get the info, but it's not moving to a new line as it iterates thru the array and all of the fields are like ONE HUGE LONG string 'declare an array Dim filenames() As String filenames = Directory.GetFiles("C:\Re_Class") Dim i, o As Integer Dim info As String
0
1397
by: n33470 | last post by:
We have a web site that is being converted from the 1.1 format into 2.0. I've noticed that after the web project has been converted, the first time that the solution is opened in VS, all of the aspx and ascx filenames are changed to lowercase. The filenames are not being changed during the conversion process. After conversion completes, the filenames remain unchanged. However, the first time that the solution is opened in VS2005, the...
4
2524
by: Scott-ASC | last post by:
I'm looking for some code that will allow me to have a random wav file played every time someone refreshes my home page. I've found some that will allow 5 different wavs (and it wasn't scalable), but I've got 100+ wavs that I'd like to use so I need some code that can scale. Any help would be appreciated.
10
10659
by: howa | last post by:
for example, there are 10K files in the directory, given that i don't know if files name, is it possible to fetch a file randomly? thanks.
5
1524
by: Tobi Hammert | last post by:
i just want to show up a random pic. <? $files = glob("./gfx/zufall/*"); shuffle ($files); if (count($files) < 1) $count = count($files); else $count = 1; for ($i = 0; $i < $count; $i ++)
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10640
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10387
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.