.
  • Print
AdvancedComputing / Using cygwin

Using cygwin

content will appear here…

Alternate access method

Yeah, I didn’t know what “alternate access method” meant either. But that is what a plus (“+”) at the end of the file permissions when you do ls -l indicates: the file has one or more alternate access methods. Typically, this means Windows ACL (access control list) mechanism allows some type of permission determination in addition to the standard Unix owner, group, world, read, write, execute permission model.

  [16:47:40 example3] ls -al
  total 23
  drwx------+ 2 ColleAn Domain Users    0 May 23 11:59 ./
  drwx------+ 8 ColleAn Domain Users    0 May 14 11:11 ../
  -rwx------+ 1 ColleAn Domain Users 1805 May 23 11:29 Client.class*
  -rwx------+ 1 ColleAn Domain Users 2047 May 23 11:29 Client.java*
  -rwx------+ 1 ColleAn Domain Users 2045 Apr 22  2006 Client.java~*
  -rwx------+ 1 ColleAn Domain Users  498 May 23 11:59 MyService.class*
  -rwx------  1 ColleAn Domain Users  783 May 23 11:59 MyService.java*
  -rwx------+ 1 ColleAn Domain Users  765 Apr 22  2006 MyService.java~*
  -rwx------+ 1 ColleAn Domain Users  326 Apr 22  2006 deploy.wsdd*
  -rwx------+ 1 ColleAn Domain Users  101 Apr 22  2006 undeploy.wsdd*

All files except MyService.java have some additional Windows ACL permissions. To deal with those, you must use getfacl and setfacl.

  [16:45:55 example3] getfacl Client.class
  # file: Client.class
  # owner: ColleAn
  # group: Domain Users
  user::rwx
  group::---
  group:SYSTEM:rwx
  group:Administrators:rwx
  group:Users:r-x
  mask:rwx
  other:---

This shows that Client.class defaults to no permissions for the owning group (“Domain Users”); but Windows has given different permissions for special groups (“SYSTEM”, “Administrators”, and “Users”).

If you do copy a file in Cygwin, you lose the “alternate access methods” on the copied version. Note that some editors (e.g. emacs) create copies when they save an edited file, so that means editing the file in such an editor will lose the “+”.

If you have a file around (perhaps emacs’ backup file) with the original Windows ACLs, use the “getfacl|setfacl” trick to reset those ACLs onto your new file:

  [16:47:22 example3] getfacl Client.java~ | setfacl -f - Client.java
awc 2007-05-23 17:01:58

ImageMagick doesn't work in Cygwin anymore

By the way, the best tutorial for ImageMagick is at www.imagemagick.org/Usage.

UPDATE

For whatever reason, the ImageMagick package you get via Cygwin setup is not as up-to-date as the Cygwin specific tarball you can download from ImageMagick.org. My current suggestion is to remove the Cygwin setup ImageMagick package, download that tarball, and install it in /usr/local. Then you won't need the deprecated libraries described below.


If, when trying to do annotation or drawing text, you receive the error

    convert: unable to read font `(null)'.

then you will need to edit a couple of ImageMagick config files in order to use any fonts. A simple test to see if you can access fonts at all is

    convert -list type

If it returns nothing, then open the file

    $MAGICK_HOME/lib/ImageMagick-6.3.3/config/type.xml

in your favorite editor. There will probably be nothing but blank space between the <typemap> and </typemap> tags. There are two files in that config directory that you can use, depending on whether you wish to use Ghostscript fonts (if you have installed the Ghostscipt package in Cygwin) or your Windows fonts. I chose my Windows fonts, so I entered the following line in that blank space between the tags:

    <include file="type-windows.xml" />

If you wish to use your Ghostscript fonts, specify that file instead. Now, when you issue that convert command again you should see a long list of fonts.

However, this is probably not enough (at least if you use your Windows fonts). Try

    convert logo: -gravity southwest -annotate 0 "TESTING" png:-| display png:-

You should see the ImageMagick logo with the word “TESTING” in the lower left (southwest) corner. If instead you get the error

    convert: unable to read font `arial.ttf'.

and no text in the lower left corner, you need to edit the type-windows.xml file. For each font, there is a line beginning glyphs="fontfile.ttf". Add the Cygwin path to your Windows font directory to each of those (this is where global search and replace is handy), for example:

    glyphs="/cygdrive/c/WINDOWS/Fonts/arial.ttf"

Your path may vary. Now try that convert command again. If it still doesn’t work, I’m sorry, this worked for me!

awc 2007-05-03 11:23:46

With the latest Cygwin updates (currently 2006-09-27, but the problem has existed since at least 2006-07), the ImageMagick commands (e.g. convert, identify) no longer do anything. They simply return to the prompt without any error message or output of any kind.

The problem is that two DLLs are no longer distributed with Cygwin's X11 packages. These DLLs have been in a deprecated state for two years, and now they no longer exist in the Cygwin distribution. See this email for an explanation of the deprecation of these libraries.

The solution (to getting ImageMagick to work) is identified in several places, but the most concise is the thread ImageMagick 6.0.4 no longer executes with package xorg-x11-bin-dlls 6.8.99.901-1.

Since the tarball pointed to there 1) contains a lot of extra stuff, and 2) may disappear without warning, I have packaged just the two DLLs into a tarball attached to this page. So, to get ImageMagick working under Cygwin (assumes you will do it from an bash shell, adjust as necessary if you try some other way):

  1. Download imagemagick-fix.tar.gz
  2. cd to the directory where the tarball exists and unpack it:
        tar zxvf imagemagick-fix.tar.gz 
    
  3. If you did not download the tarball to /, then move the DLLs to the appropriate place:
        mv usr/X11R6/bin/cyg*.dll /usr/X11R6/bin 
    

Now, ImageMagick commands should function as normal.

Note: if/when the Cygwin ImageMagick package is updated to not need those DLLs, you will probably have to manually delete these two files from /usr/X11R6/bin:
      cygdps-1.dll
      cygdpstk-1.dll 
awc 2006-09-27 14:07:20


People should not be afraid of their governments. Governments should be afraid of their people.

V
in V for Vendetta, 2005

Look for:
A2 Web Hosting
Creative Commons License
loaded 2010-09-09 17:01:05 • last modified 2007-05-23 17:04:35
Privacy PolicyDisclaimer
• awcfamily.com is powered by PmWiki v.2001944 •
• all content (unless noted otherwise) © 2010 A W Colley
this website and its contents are licensed under the
Creative Commons Attribution-NonCommercial-NoDerivs 2.5 License
Registrar
Valid XHTML 1.0 Transitional