473,320 Members | 1,958 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,320 software developers and data experts.

lock a file during execution of an app

Hello,
I would like to block two files during the execution of my prog to
avoid that another prog modify them (write in).
Is that possible?
Nov 15 '05 #1
3 8740
Hi,

You might open them exclusively..

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Cyril Vi?ville" <cy************@hotmail.com> wrote in message
news:75**************************@posting.google.c om...
Hello,
I would like to block two files during the execution of my prog to
avoid that another prog modify them (write in).
Is that possible?

Nov 15 '05 #2
Use System.IO.FileShare.None to specify no sharing when you open the file,
and keep the file open as long as you don't want anyone else to access it.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
For a laugh, try web browsing with Opera's User Mode with Nostalgia enabled
Nov 15 '05 #3
Morten Wennevik <Mo************@hotmail.com> wrote in message news:<opr1u71sqchntkfz@localhost>...
Use System.IO.FileShare.None to specify no sharing when you open the fil
e,
and keep the file open as long as you don't want anyone else to access i
t.


Really thx. Is it the only solution?
Nov 15 '05 #4

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

Similar topics

2
by: owais | last post by:
H I want to display progress bar during execution of windows form. When I execute DTS package the form will idle till the DTS package finishes Please help me in this regard. its an urgen ...
1
by: Nand Belani | last post by:
Hi, I have a MS Access 2000 database on the network, it is secured and the mdw file is on the network. The database works for most of the users on the network, but does not open for two of the...
2
by: Ying Lu | last post by:
Hello all, I met a problem about cannot start postmaster. The situation I met is that I was running postmaster, but because of the server closed all my konsole. As a result, I did not...
2
by: gvindia | last post by:
Hai, Please help me. How can lock file or folder using c/c++ in windows. regards, gv.
8
by: paquer | last post by:
Database Users need to have Read/Write etc... permissions to the folder where the Database resides in order to create the lock file. I have read only users. I have set up the Shortcut that links...
2
by: GUILLAUME LECOMTE | last post by:
Hi, I am a bit new to db2, and I am unable to find a proper command syntax where I can print values during execution in a stored procedure Pls help. regards, guillaume
1
by: speedriser | last post by:
Hi i have a XML file named Q317666.xml as follows <?xml version="1.0" encoding="ISO-8859-1" ?> - <Collection> - <Book Id="1"> <Title>Principle of Relativity</Title> <Author>Albert...
6
by: michael.spoden | last post by:
Hi, how can I fix lock-waits during an online backup? Is an online backup in DB2 V8.2 not realy online? I'm using DB2 V8.2 Fixpak 15 on Linux. The command to perform the backup is: db2 backup...
1
by: ramnarsingarao | last post by:
during execution of a jsp page, i am getting some alignment problems like page contains some text boxes and some buttons , those r not properly loaded.i am getting alignment problem,so please help...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.