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
72 Views Asked by MichaelD At
1
There are 1 best solutions below
Related Questions in FILE
- Saving FileSystemInfo Array to File
- C programming: Create and write 2D array of files as function
- How can I change a specific line in a file with node js?
- Grabbing Edits from two strings
- In Android, would it be possible to open a file in the 'values' folder and to read its content?
- Using paths bonded to a XCode project to be shared
- Why am i getting these invalid characters before my file data?
- Optimum directory structure for large number of files to display on a page
- C Reading binary file with fread()
- Renaming a File() object in JavaScript
- How to write the current time to a new line of a .txt file on php execution
- introduce c++ into html
- How can I create a simple text file on a windows phone (8.1) that can be accessed trough USB cable?
- Pop-up and download zip file in ASP.NET
- Using access() in C
Related Questions in FILESYSTEMS
- What kernel level functions are called when we perform write in ext3 file system?
- How to save a file to desired location in c++?
- MongoDB over Traditional File Based System
- How to reliably detect that an atomic move of a directory failed because the target already exists
- Meteor - Create a new folder in the public directory on account creation
- Storing images in MSSQL vs Disk
- Why segment files into chunks for HTTP streaming?
- Difference between stdout and /dev/stdout
- find and remove all closed files that are not modified in some-time
- TypeScript + Node.js FileSystem issue
- Scan folders with non English letters in a given directory
- unknown field 'ioctl' specified in initializer
- how can i encrypt every file with a different key using encFS
- How is a file loaded in the FAT file system?
- Ext.device.filesystem.FileEntry.read() - type: "text" returns blank file
Related Questions in READ-WRITE
- Read and Write file that is used by another program
- Faster bash writing to file
- How to permissions to a group in Django 1.8?
- reading and copying lines of text in a specific way
- read/write bit from a structure
- How to read sd card sector by sector? (Android)
- How to repeatedly pass inputs and outputs between a C# Stream and a Python Script?
- Open failed: EACCES (Permission denied) in Android
- Python open file in shared mode
- Connecting to Serial port in QT
- Writing and reading to linux /proc/... filesystem without lseek()
- perl6/rakudo: Problem with writing on the loop-variable
- Improper encoding in Java Read/Write file
- Is it possible to merge two text files without reading lines, using java?
- Sqlite multithreading operations
Related Questions in FILE-LOCKING
- Read a file while another program locked it
- XML file locks sequence file SAP PI
- Truncate locked file
- Open docx file with password?
- flock() doesn't preventing other process to get exclusive lock
- Preventing opening file twice from different processes
- Usable lock-files in Java
- Lock file when writing to it from parallel processes in R
- Lock future file
- Copying files with file locks in Java
- Rails: Wait for image file to be fully written by RMagick before continuing logic
- HTML file input - lock the file once selected
- How can I lock a file in .net so that only my app can access it?
- Is a move operation in Unix atomic?
- Preventing simultaneous db table row access
Related Questions in SHARED-FILE
- How to create an int file
- How to get the filename of a shared WhatsApp text file in Xamarin Forms Android?
- How to use the same shared disk/filesystem with boltdb?
- Write to a file present in Linux system having a Samba server from a windows system
- Android Media Store API does not find image which have been created by Google Photo in External Storage
- Mercurial repository & MSVS - two projects & shared files
- Why duplicate excel files are created when saving a shared file
- How to save numpy array from PySpark worker to HDFS or shared file system?
- How to use shared uploaded file on Google Colab
- Error source file is not valid UTF-8 when sharing project code from Ubuntu host to macOS guest
- Java. Update (rewrite) shared file
- Common shared CSS JS files in a directory shared between similar sites?
- is there a way to synchronize write to a file among different processes (not threads)
- Programmatic way to get open files info similar to Computer Management\Shared Folders\Open Files? (Server 2012R2)
- Excel macro-enabled workbook corruption
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 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