From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.help Subject: Re: API for excess DOS file attributes?? Date: Fri, 30 Sep 2011 00:55:48 +0300 Message-ID: References: <83ehyzdrmz.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1317333388 5361 80.91.229.12 (29 Sep 2011 21:56:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 29 Sep 2011 21:56:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 29 23:56:24 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R9Oae-00078k-Es for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Sep 2011 23:56:24 +0200 Original-Received: from localhost ([::1]:52649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9Oad-0006T4-Uv for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Sep 2011 17:56:23 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9OaW-0006Sl-30 for help-gnu-emacs@gnu.org; Thu, 29 Sep 2011 17:56:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9OaU-0004LA-DP for help-gnu-emacs@gnu.org; Thu, 29 Sep 2011 17:56:15 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:47668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9OaT-0004L0-Ux for help-gnu-emacs@gnu.org; Thu, 29 Sep 2011 17:56:14 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R9OaR-00071f-Iz for help-gnu-emacs@gnu.org; Thu, 29 Sep 2011 23:56:11 +0200 Original-Received: from 214-8-202-46.pool.ukrtel.net ([46.202.8.214]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Sep 2011 23:56:11 +0200 Original-Received: from gavenkoa by 214-8-202-46.pool.ukrtel.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Sep 2011 23:56:11 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 214-8-202-46.pool.ukrtel.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1 In-Reply-To: <83ehyzdrmz.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82375 Archived-At: 29.09.2011 23:23, Eli Zaretskii пишет: >> From: Oleksandr Gavenko >> Date: Thu, 29 Sep 2011 22:59:09 +0300 >> >> So I think that I can not excess to this data from Emacs >> (native Windows build). > > Not from Lisp, no. > >> I try rewrite 'follow-cygwin-symlink' from: >> >> http://www.emacswiki.org/emacs/setup-cygwin.el >> >> for more strict conformance of definition of symbolic link >> in Cygwin (from 'cygwin-ug-net-nochunks.html'): >> >> The file style symlinks are files containing a magic cookie >> followed by the path to which the link points. They are marked >> with the System DOS attribute so that only files with that >> attribute have to be read to determine whether or not the file is >> a symbolic link. > > What's in setup-cygwin.el is about as good as you can get in Lisp. A > better solution would be to add to file-symlink-p and > make-symbolic-link the ability to recognize and create Cygwin-style > symlink (and Windows 7 style symlink as well), but that requires > changes on the C level. > OK. I get next new definition of 'follow-cygwin-symlink', which work with new (to Cygwin 1.7) style of links: (when (eq windows-system 'w32) (defun follow-cygwin-symlink () "Follow new-style (and also UCS-16) Cygwin symlinks." (save-excursion (goto-char 0) (when (looking-at "!\xff\xfe") (find-alternate-file (substring (decode-coding-string (buffer-substring (match-end 0) (point-max)) 'utf-16-le) 0 -1) ; -1 for stripping final \0. )))) (add-hook 'find-file-hooks 'follow-cygwin-symlink) ) I don't incorporate it back to emacswiki as don't understand some part of old code. Maintainer of this file is Drew Adams, but I don't know how contact with him.