473,320 Members | 1,839 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.

Check for locked file

How can I check if a file is in use, I have file and I want to know if
someone have the file opened for writing, I dont care if they have opened
the file readonly.

The type of file can be all types.

Erik Fjelldal
Nov 23 '05 #1
1 1516
try to open the file exclusive , if you can`t do that ( error is raised but
ofcourse catched by you ) the file is already opened by someone else

regards

Michel Posseth [MCP]
"Erik Fjelldal" <Er***@newsgroup.nospam> wrote in message
news:u7*************@TK2MSFTNGP10.phx.gbl...
How can I check if a file is in use, I have file and I want to know if
someone have the file opened for writing, I dont care if they have opened
the file readonly.

The type of file can be all types.

Erik Fjelldal

Nov 23 '05 #2

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

Similar topics

6
by: Pierre-Yves | last post by:
Hello, I would like to prevent my perl program to be executed several times simultaneously (if the program is already running, I would like to display a message like "another instance of this...
2
by: Ken Durden | last post by:
I'm setting up an interface where clients must perform external locking before calling certain commands. I do this to force them to specify the duration the action they performed must persist...
2
by: Janice | last post by:
How to obtain the lock status of a file held by other process? If I read the file that is locked by other process, the read would return -1. If the file is locked by other process, how to put the...
4
by: hkappleorange | last post by:
I ued this code to connect to a mdb file A = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=C:\Inetpub\wwwroot\ASPX\Authors.mdb" )
0
by: Peter | last post by:
Question one: How do you detect if a file is locked. I have a program that is cleaning up a temp directory and I want to scan the files to see if they are locked before I try to delete them. ...
4
by: Xero | last post by:
hello. how do you check if a file (say, a txt one) is being used by another process? thanks. -- Xero http://www.chezjeff.net My personal web portal
5
by: cmay | last post by:
The only examples I have seen on how to check if a file is locked is to try to open it a catch an exception. MS has stated that you should never use error trapping in this manner. Is there no...
6
by: elake | last post by:
I found this thread about a pst file in Windows being locked and I am having the same issue. ...
1
by: Joe | last post by:
any other way than Try / Catch / Finally ??
7
by: xerc | last post by:
Hey all, So I have a script that runs pretty much every 5 minutes or so to look for updated files locally on a server. New files (ranging in size from 1KB - 2MB) are then FTP'd to another server....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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
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.