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?


Eliot Moss sent the following at Thursday, December 12, 2019 2:19 pm
>On 12/12/2019 7:00 AM, Ulli Horlacher wrote:
>
>> I need to store some data (a few kB) non-persistent.
>> On a real UNIX I would use /var/run, because after a shutdown all its
>> content is lost.
>> But on cygwin /var/run is stored on disk.
>>
>> I cannot use an environment variable, because different processes need
>> to read/write the data.
>>
>> /proc is non-persistent (in respect to a reboot), but It is not a
>> generic storage place.
>>
>> What can I use with cygwin instead?
>>
>> Installing third party software is not an option, it must work with a
>> standard Windows (and cygwin).
>
>I would think of temp directories, such as /tmp. They can be cleaned out
>at will on restart, no?

Bash runs the file ~/.bash_logout when it exits.  One could use that to
clear a temp file out of /tmp.

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.

That assumes that this is consistent with your need for different
processes to read/write data.

Good luck,

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

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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