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
2 answers

How to get the "result" from a contextmanager using 'with'

I found a demo of a file locking class (here: https://groups.google.com/forum/#!topic/pug-pe/mQr7KX-cenU), but I don't quite understand the mechanics of using it. @contextmanager def FileLock(lock_file): if os.path.exists(lock_file): …
David Doria
  • 9,873
  • 17
  • 85
  • 147
0
votes
1 answer

Trouble cleaning up after serving generated file from asp.net Page_Load

I want to serve a dynamically created binary file from an asp.net web page via a http request parameter like so: www.host.com/?Download=file. So far I have protected void Page_Load(object sender, EventArgs e) { if…
NiloCK
  • 571
  • 1
  • 11
  • 33
0
votes
1 answer

Batch: Checking if a file is locked does not work

I wrote the following batch to do the following steps: Check if a file on a server is opened by another user make a backup of the file open the file 2>nul ( >>test.xlsx (call )) if %errorlevel% == 1 goto end @echo off rem get date, make if file…
0
votes
2 answers

Simultaneous files access via App and USB

assuming I have a (stock) android 4.x tablet connected to a microcontroller board via USB. The board is able to access the SD-card as USB mass storage and reads/writes to a file on the card. Now there should be an app on the tablet, which…
0
votes
1 answer

Enterprise Library Logging Block - Locking the file and FTP fails to download it

I have an ASP.Net MVC 5 application, it uses Ent Lib 6 Logging Application block. Details: My web site is hosted on shared hosting server. We use Filezilla (FTP client) to publish and download files/logs. Log file is created on server…
ndd
  • 3,051
  • 4
  • 25
  • 40
0
votes
0 answers

worksheet.save(),it stay locked

I have developed a windows form project that is export large date in excel. Sometimes worksheet.save() method takes 1 hour or infitine time. I think it stay locked, but I don't know why. Does anyone have any ideas to solve this? ... …
RockOnGom
  • 3,893
  • 6
  • 35
  • 53
0
votes
2 answers

Overwrite a properties file from the FileOutputStream obtained through FileDescriptor FD

Peculiar problem is When I am using the properties.store code with the FileOutputStream obtained from file path, the above method works all fine but when I do that from FileOutputStream obtained from FileDescriptor the properties file append to it,…
manocha_ak
  • 904
  • 7
  • 19
0
votes
1 answer

How to wait new file to be released

I am creating a new *.csv file and after creating it I want to send this file as an attachment in an email but file is locked for 10 - 15 seconds. Is there any way to wait file to be released and then send this file wihout getting any exception:…
cihadakt
  • 3,054
  • 11
  • 37
  • 59
0
votes
2 answers

how to release file that is in use by another program

How to release file that is in use by another program in c#? if(!IsFileLocked(fileName)) { // write in file } else { // first ReleaseFile(fileName); // two write in file }
Hossein Hagh
  • 127
  • 2
  • 3
  • 15
0
votes
2 answers

Can't build my service : Unable to copy file because it is being used by another process

I build a windows service in c# .net. I added Pre-Build and Post-Build event to automatically deploy my service on the build. But sometime I got this error : Unable to copy file "[CompletPath...]\bin\Debug\Business.Data.dll" to …
0
votes
3 answers

c windows multithread file lock

Is there, on Windows, any easy way to lock a file in an exclusive way (reading and writing for my software) in multithread C code? I've tried the LockFileEx but it works only between process and not for thread(of the same process). Note: My problem…
0
votes
3 answers

C# File locked after making it

I am making a windows service that in part of it makes a .eml/txt file using the FileStream and StreamWriter and it works perfectly, doing everything I need it to do. The only problem is that the new files it makes are for some reason still in use…
user345453
  • 52
  • 1
  • 10
0
votes
1 answer

Windows vs OSX FileLock OutputStreamWriter

I wrote a java application that accesses a file while other Processes in other VMs try to do the same. Therefore I use the FileLock class: FileOutputStream fos = new FileOutputStream(filePath,append); FileChannel f = fos.getChannel(); …
Mathew
  • 307
  • 1
  • 11
0
votes
1 answer

Locking a file across multiple nodes with common FS

We have a spring integration application which is running in a cluster on multiple nodes. A NFS drive is mounted across all nodes and is readable by all nodes. On NFS there is a folder which is being watched by file:inbound-channel-adapter of all…
Vishal Biyani
  • 4,297
  • 28
  • 55
0
votes
2 answers

How to update files in a site on IIS via the site?

Okay, so we have a CMS site in IIS, running on ASP.NET 4.0. The user wants to update some images on the site, but because they have been recently served up, IIS has a handle open to them, locking the files. This leads to the user receiving the…
eidylon
  • 7,068
  • 20
  • 75
  • 118
1 2 3
12
13