Questions tagged [filelock]

File locks are locks held by an application, preventing interference from other processes. Locks may be advisory (may be ignored by others), or mandatory, enforced by the operating system, depending on implementation.

File locks are locks held by an application, preventing interference from other processes. Locks may be advisory (may be ignored by others), or mandatory, enforced by the operating system, depending on implementation.

190 questions
0
votes
1 answer

Visual Fox Pro file access

I have a function whitch creates .xml files with some data inside. Everytime firstly it deletes the old file. Everything works fine except it sometimes gets frozen and the file itself becomes locked. It's size is 0 kb and program can't even delete…
The50
  • 1,096
  • 2
  • 23
  • 47
0
votes
0 answers

Unlock File when program process shuts down in Java?

I have a program that locks a file like so, where lock is the file: FileChannel channel = new RandomAccessFile(lock,"rw").getChannel(); FileLock lock = channel.lock(); The main purpose is, using a secondary program, check to see if the program was…
user2352923
  • 47
  • 1
  • 9
0
votes
0 answers

File sharing services with locking

I have a file server and it is connected to 10 windows nodes using LAN . In a production shared folder we are having a big data with some software codes . every developers are using the same file . Some times User A didn't know User B is using the…
James Arems
  • 87
  • 3
  • 11
0
votes
1 answer

Lizardfs or Musefs File lock for secondary user

I have 2 lizardfs servers and file system is shared to our LAN network . Shared folder is mounted to 3 of our windows systems . File copy , paste , delete , create all are working fine . But , is there any option to lock a file if anyone is already…
James Arems
  • 87
  • 3
  • 11
0
votes
1 answer

The process cannot access the file after submitting to SendEmail()

I create an XML file that I need to email to users when they register. After creating the XML file I pass it as an attached filename (with ServeMapPath) and the email programs send the email message with file. Yea. However, I then want to delete…
IrvineCAGuy
  • 211
  • 2
  • 12
0
votes
0 answers

SSIS Package Hang randomly on execution phase

I have a master package which execute 3 packages. All sub-packages has data flow task in which it extract data from excel file which is placed on a SHARED LOCATION, and load it to SQL SERVER database table. Each sub package load different file to…
0
votes
0 answers

How to check file is opened or not in java is not working

I try to check file is opened or not in java using following examples . I use Apache Commons IO library... boolean isFileUnlocked = false; try { org.apache.commons.io.FileUtils.touch(yourFile); isFileUnlocked = true; } catch (IOException e)…
Terance Wijesuriya
  • 1,928
  • 9
  • 31
  • 61
0
votes
1 answer

Java tryLock release lock on multiple JVM

I have problem with file lock on Linux in Java I have two apps on different hosts(A and B) and shared folder for file lock. In A I get lock with channel.lock(). Then I call channel.tryLock() in B. It throws OverlappingFileLockException. And its…
0
votes
0 answers

How to implement file locking for linux in java

In my project a a process is creating a file and different process of other software reading that file.As file is created the other process reads it even the size of file is 0.I want to implement the locking mechanism on file for linux because…
nitin
  • 61
  • 3
0
votes
3 answers

Does the following java code guarantee and exclusive lock on an unopened file in Windows?

Does the following Java code guarantee an exclusive lock on an unopened file in Windows? import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class Test { public static…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
0
votes
2 answers

How to provide file lock for properties file in java?

I am using property file to store the count of two variables: TransId RegisNumber The logic works as : 1) Initially the two variables is initialized to 1 and is stored in the Sequence.properties file. 2) The RegisNumber will be 1 whereas…
0
votes
0 answers

How to force Apache to release filelocks?

I'm not sure if I am using the correct terminology here, but after rendering a file on localhost, on a local machine, I am unable to save the file after editing - the file is locked and noted as being opened by another program. This turns out to be…
Andrew Seabrook
  • 397
  • 2
  • 17
0
votes
0 answers

How to lock a file on remote machine?

I need to read and write serveral files in serveral remote machines. Mainly using java, and shell is also ok. At first, I want to ssh to the remote machine and read/write file, and using Channel.lock() to lock the file. But I found it difficult to…
NingLee
  • 1,477
  • 2
  • 17
  • 26
0
votes
3 answers

Safest way to copy a file

I need to merg two PDF files. However sometimes a file might be locked up I wrote this code, but I'm wondering if it's not the smartest solution: private static int FILE_LOCKED_WAIT_PERIOD = 1000; while (true) { …
aron
  • 2,856
  • 11
  • 49
  • 79
0
votes
1 answer

Disable locking of Neo4j graph database?

My application is populating a Neo4j graph database at /tmp/import.db. In addition to my unit tests I like to use the Neo4j browser (AKA Neo4j Community) to do some digging in that same database. When the browser is running, my application crashes…
user1019830