473,395 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

file inuse

I am creating a file with identifier+dateandtime, when on multiple requests
at the same time, it fails, it either says file in use , can't be deleted?
can any one of you suggest, how to uniquely define a file name??

Thanks,
Venkat.
Nov 17 '05 #1
3 1420
You can use System.IO.Path.GetTempFileName() to have the system generate an
unique file name.

Gabriel Lozano-Morán

"Venkat" <Ve****@discussions.microsoft.com> wrote in message
news:F5**********************************@microsof t.com...
I am creating a file with identifier+dateandtime, when on multiple
requests
at the same time, it fails, it either says file in use , can't be deleted?
can any one of you suggest, how to uniquely define a file name??

Thanks,
Venkat.

Nov 17 '05 #2
I don't know what you are using the file for but I'm going to assume
you are using it as a temp file. If this is correct then you can use
Path.GetTempFileName().

Check out the documentation at
http://msdn.microsoft.com/library/de...enametopic.asp

Jason

Nov 17 '05 #3
It was my mistake to assume that you were talking about temp files. If you
really want an unique filename and you don't care about the size or
structure you can use the static method Guid.NewGuid() this will return you
a new instance of the Guid class use the ToString() method of this class and
use the yielded value as an unique file name.

Gabriel Lozano-Morán

"Jason Clark" <jj*********@gmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
I don't know what you are using the file for but I'm going to assume
you are using it as a temp file. If this is correct then you can use
Path.GetTempFileName().

Check out the documentation at
http://msdn.microsoft.com/library/de...enametopic.asp

Jason

Nov 17 '05 #4

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

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
3
by: cubaman | last post by:
Hello: Im workin with an app that checks for incoming files to a given folder using a FileSystemWatcher object. My problem is that if the file is too big, the Created event fires before the file...
2
by: =?Utf-8?B?Z2Fsc2k=?= | last post by:
Hi I am trying to read a file or get it's size while this file is written by another process. When i use the windows explorer i can read the file or check it's size . When i use the...
4
by: sherifffruitfly | last post by:
Try to do something with it, and look at the exception? Some other way? Thanks!
9
by: tshad | last post by:
I am trying to get access to a file that may still being written because the file is so large (7-10MB). I get an error: The process cannot access the file 'c:\TestDocs\XMLFiles\492172.XML'...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
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...
0
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...

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.