X-Spam-Check-By: sourceware.org Date: Sun, 20 May 2007 11:29:14 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: How to uniformly point to the root of a drive? Message-ID: <20070520152914.GB9021@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.14 (2007-02-12) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Sun, May 20, 2007 at 04:18:07PM +0100, Thorsten Kampe wrote: >Hi there, > >is there a way to consistently point (in a script for instance) to the >root of a removable drive (flash drive)? > >The root could be /cygdrive/g on one computer and on the other >/cygdrive/f (I have no control of the drive letters). One solution >would be to install Cygwin to \ (instead of the standard \cygwin) but >for clarity's sake I would like to keep the Cygwin stuff in a >directory of its own. > >Any suggestions or hints? Do you mean that you've got cygwin on a removable drive and want to figure out where it's running from? If so, then running a script from the drive and looking at $0 might work. If that doesn't give the full path then /proc/self/exe will but getting the symlink info might be tricky if you are in the setup phase of trying to figure out how to get to something like /bin/readlink.exe. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/