This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: non-persistent storage?


>On Thu, Dec 12, 2019 at 5:08 PM Ulli Horlacher wrote:
>
>>Erik Soderquist sent the following at Thursday, December 12, 2019 5:45 pm
>>
>> On Thu 2019-12-12 (21:59), Buchbinder, Barry (NIH/NIAID) [E] via cygwin wrote:
>>>
>>> If the temp file was created by mktemp and the name saved in an
>>> environmental variable, each bash shell could have its own file with
>>> not risk that an instance of bash would erase another instance's file.
>>
>> I need the opposite: all processes must read and write the same data!
>> And the data must be gone when system shuts down or even if there is a
>> power failure.
>
> This is very hacky, but I believe you can get the effect you want by
> having an admin process auto-start at host startup, identify itself, and
> then set parts of its own /proc/ process ID tree as world read/write.
> I think this will give you the "destroyed even at power failure"
> impermanence you are looking for. I know it is not in the normal
> layouts (like /var/run/ would be), but we are working around limitations
> imposed by Windows.

One could put a script, batch file, or a link thereto in one's startup
folder that will run on Windows' boot.  The script/batch file would be
written to clean out the tmp files.  Google << windows startup folder >>.
If all processes, regardless of whether they start with the same
shell/subshell, will share the same temp file, one could create the file
upon boot using the same script.

Also, one could make the script that creates the temp file (e.g.,
.bashrc) check the file or an environmental variable so that a subshell
doesn't create a new temp file, if that's how you want it.

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]