Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Score of 1
1 answer
80 views

In Windows, the CreateFile function has a sharing mode, which you can use to prevent other processes from opening files or writing to files you are currently operating on. The same mechanism was ...
Score of 0
0 answers
112 views

The following .NET 8 targetted code (formatted as xunit test) fails on my machine (Windows 11), typically j is something between 50 and 100. [Fact] void FileMoveException() { var sourceFilePath = ...
Score of 2
0 answers
154 views

I'm trying to do an exercise from Advanced Programming in the UNIX Environment where I need to: Open a file that contains a counter. Fork a process. Have the parent and child increment the counter ...
Score of 1
1 answer
88 views

man 2 flock on Linux says: [L1] Locks created by flock() are associated with an open file description (see open(2)). This means that duplicate file descriptors (created by, for ...
Score of -1
1 answer
95 views

Current situtation: I am running a docker container on a WAGO PFC200 PLC (custom embedded linux firmware). The container runs a python script which collects systeminfo like cpu load, memory usage etc. ...
Score of 0
3 answers
199 views

I have these methods to backup my SQLite database and upload it to my blob container: public static async Task<string> CreateBackupAsync() { // Generate the timestamped backup file name ...
Score of -1
1 answer
66 views

I have a file that is under lock by the JVM (it is a jar file that provides classes that are loaded at some point during runtime). When my program exits I want to delete this file. However, simply ...
Score of 1
0 answers
314 views

As mentioned elsewhere, Python's FileLocks do not delete themselves after being released on Linux ([1][2]). This fails: import os from filelock import FileLock with FileLock("/tmp/test.lock"...
Score of 0
2 answers
194 views

I need to write to and read from a config file using shell CGI, and I also have a C program that must read and modify the config file every few seconds. I tried using flock to maintain data integrity ...
Score of 1
2 answers
94 views

Using powershell, i have this code block ForEach ($Filepath in $BaselineFile_NME,$DailyOutputFile_NME) { $SHA1 = [Security.Cryptography.HashAlgorithm]::Create( "SHA1" ) $stream_HSH = ([IO....
Score of 1
1 answer
1116 views

I want to test mandatory locking in linux (Ubuntu 22.04.2 LTS) and I do the following steps 1- mount /dev/vgg1/lvv11 /u03 -o mand 2- chmod g+s /u03/datafile.dbf 3- chmod g-x /u03/datafile.dbf and then ...
Score of 0
1 answer
150 views

In Java on Ubuntu, I'm using a FileLock to lock a file. The problem regularly happens on a server that runs on Debian. To make it easily reproducible, I wrote a minimal sample application (see below). ...
Score of 0
1 answer
103 views

Is there a way to use CreateFileW and with FILE_SHARE_WRITE and then after a while change that to only FILE_SHARE_READ? I could not find any documentation, but it seems memory map files can elevate ...
Score of 1
1 answer
102 views

I need to lock a file using Java to prevent file deletion by another process, but allow copying of this file. It should be made by two methods like lock() and unlock(). I tried using a FileLock, but ...
Score of 0
1 answer
325 views

I was looking for a function to find the username locking a file. I found this one which works fine: Function GetUsername(fileDir As String, fileName As String) As String 'On Error Resume Next Dim ...

15 30 50 per page
1
2 3 4 5
39