delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/01/16/11:35:45

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7D6233858C39
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
header.from=mehconsulting.com
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=m.gmane-mx.org
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin AT cygwin DOT com
From: Mark Hansen <cygwin AT mehconsulting DOT com>
Subject: Re: Does cygwin have an 'autorun' utility/package?
Date: Sun, 16 Jan 2022 08:35:21 -0800
Message-ID: <056dd5de-878e-b04f-6717-c9506701e797@mehconsulting.com>
References: <66df682d-2a2f-7429-39d9-f7b32a79c693 AT mehconsulting DOT com>
<20220116161249 DOT tvizujlenvqkdyyp AT lucy DOT dinwoodie DOT org>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101
Thunderbird/52.7.0
In-Reply-To: <20220116161249.tvizujlenvqkdyyp@lucy.dinwoodie.org>
X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,
HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE,
SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On 1/16/2022 8:12 AM, Adam Dinwoodie wrote:
> On Sun, Jan 16, 2022 at 06:46:06AM -0800, Mark Hansen wrote:
>> I have an application running under Linux which I would like to move to Windows
>> (with Cygwin). This application depends on getting notifications when a CD Rom
>> drive status has changed (like audio CD inserted, ejected, etc.). For this, I
>> use a Linux utility application named 'autorun':
>> 
>> https://linux.die.net/man/1/autorun
>> 
>> What's nice about this application is it can be configured to send notifications when
>> various drive events occur.
>> 
>> I've looked through the package list for Cygwin and don't see anything like this.
>> 
>> Does Cygwin have anything that could work?
>> 
>> My Windows/C skills are about 20 years old so I was hoping to find an existing utility
>> application that can provide this functionality, rather than try write my own.
> 
> I don't think Cygwin has anything of this ilk. It's the sort of function
> that inherently requires some integration with the underlying operating
> system in ways that the Cygwin compatibility layer makes difficult:
> a tool providing that sort of function on Cygwin would need to both
> interface with the underlying Windows OS to get notifications of CD
> drive events, then provide some sort of *nix-style interface for Cygwin
> applications to attach to.
> 
> Depending on precisely what you need, you might be able to automate
> things with a simple Bash/Python/whatever script.  Something like the
> following would let you run a specific program when a CD is inserted
> into drive D:, for example:
> 
>      #!/usr/bin/env bash
>      set -eu
>      while :; do
>          if [[ -e /cygdrive/d ]]; then
>              echo "CD detected, running '$PROGRAM'"
>              cygstart "$PROGRAM"
>          else
>              echo 'No CD detected'
>          fi
>          sleep 60
>      done
> 
> HTH
> 
> Adam
> 

Thanks. I need to know specifically when an Audio CD is inserted. I guess I'll keep
looking. Thanks.


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019