I have a shared file with access through network. This file has direct link and being downloaded almost permanently, so it's always locked for reading. But sometimes I need to update this file with new data using java code, but I can't do it.
I want to know ways, principles, best practices on how to achieve this. Maybe I should use a controller instead of direct link to put some logic to create a copy for reading purposes, but copy needs to be updated as well while being readed. Connection interrupting is undesirable. Any ideas please???
Java. Update (rewrite) shared file
74 Views Asked by MichaelD At
1
There are 1 best solutions below
Related Questions in FILE
- Helpt with reading files
- Why can't I use the file pointer after the first read attempt fails?
- Can't read the file using std::wifstream C++
- How can the scanner reread the entire file after it has already executed hasNextLine once?
- What is 'Invalid Load Key, '\x00'
- php $_FILE variable undefined index
- Data loaded from the file is not returned in the correct order
- File splitting and encryption
- Optimizing an s5cmd command that uses awk to generate a text file
- segmentation fault while reading in text file ( c++ )
- File.OpenText is adding C:\ to the front which is an error
- UTF-8 issue with excel
- How to upload files to MediaWiki APIs in Rust?
- No such file or directory: '/tmp/tmp_ejr26m6.upload.mp3' in Django
- Problems accessing zip files on the react front end from express backend
Related Questions in FILESYSTEMS
- Where exactly is the first data sector on a FAT file system?
- `df` command not capturing entire output in perl
- Is it possible to mount a logical volume without wiping the data?
- Speed up search of remote directories
- How to change the directory file system without losing files?
- Flutter SDK: Files Deleted Automatically (e.g., dart.exe), Errors in Android Studio
- How to store metadata for a UTF-8 text file cross-platform?
- fsck error on boot: dev/mapper/ubuntu--vg-ubuntu--lv: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY
- rouble with mounting Python code to FUSE: No response and prolonged processing ---
- mkfs.erofs erofs: failed to lookup selabel
- How to deny user access MacFuse file system by the really path
- Is it faster to read a file on an NVMe using threads?
- list folders containing mp3 files using the Capacitor Filesystem
- How to use xdg-open in bwrap environment to open dir in the unsandboxed filesystem
- How to provide content of (locally) encrypted files to the iOS and macOS system
Related Questions in READ-WRITE
- Using Python to connect to SharePoint via App sign-in (Client ID, Secret & Tenant ID) to Write or Read Files
- Python reads a file to verify user response and fails
- Is it possible to do load balance between database hosts in laravel read & write connections?
- how do i read the next line after finding a variable in a text file?
- problem with the frequencies output in c program which should compare txt file to keywords and output frequency
- Reading and Writing special characters in Python
- Is there a way to include a json file in my MAUI app that i can read and write to
- Linux TTY Operation sequence
- problem of separation of read and write operation to aurora db
- Read and modify XML file line by line in Python
- Read JSON File From Database in Anuglar
- Invalid course module ID
- How can I ensure that transaction.atomic() uses the default database for both read and write queries in Django?
- How to Read and Write inside csv files using python with Azure Functions
- Replacing a line in text file while in a for loop {python}
Related Questions in FILE-LOCKING
- Check for open file and retry operation
- linux mandatory locking for file locking
- Java's FileLock allows to lock twice
- Change CreateFileW dwShareMode
- Prevent file deletion, but allow to copy
- GetSecurityDescriptor parameters
- How to Queue Python script execution calls?
- Replacing a Locked Excel File on Microsoft SharePoint using R and Microsoft365R
- Meaning of CF_OPEN_FILE_FLAG_FOREGROUND flag with CfOpenFileWithOplock
- Java file sharing/byte range locking
- Ignite Server pod unable to acquire lock to file
- Powershell script open textfile with executable and lock textfile
- liquibase.lockservice.StandardLockService.waitForLock
- FileChannel.tryLock works locally but hangs on remote machine, accessed via SSH
- FileLock for two exclusive processed
Related Questions in SHARED-FILE
- VBA Code not working on a shared excel file
- Common disk on a Dual Boot between Windows 11/Ubuntu
- How to get the filename of a shared WhatsApp text file in Xamarin Forms Android?
- Why duplicate excel files are created when saving a shared file
- Android Media Store API does not find image which have been created by Google Photo in External Storage
- "Item not found" error is returned when i try to get file details that has been shared by the external user
- Java. Update (rewrite) shared file
- Error source file is not valid UTF-8 when sharing project code from Ubuntu host to macOS guest
- Processes who read and write from/in a shared file in c
- Programmatic way to get open files info similar to Computer Management\Shared Folders\Open Files? (Server 2012R2)
- How to use shared uploaded file on Google Colab
- Do I need lock or mutex for shm_open
- Excel macro-enabled workbook corruption
- How to use the same shared disk/filesystem with boltdb?
- How to create an int file
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Hi @MichaelD why dont you use the mv command ? You could create the new file as say new.tmp however you please then use "mv new.tmp original.txt" to update the file, mv is atomic so this should work as you expect