POSIX timer_create with SIGEV_THREAD

I'm having trouble to get the timers working. Compiling is no problem, but I get a runtime error when I run the code (Code=22, Invalid argument).
Here is the code for creating the timer:
void timeoutHandler(union sigval arg)
// do something with arg.sival_ptr which should point to a function
void createTimer()
struct se sigevent;
se.sigev_notify = SIGEV_THREAD;
se.sigev_signo = SIGRTMIN;
se.sigev_value.sival_ptr = a_function_ptr; // pointer to function that should be passed to the thread routine (timeoutHandler)
se.sigev_notify_function = timeoutHandler;
timer_create(CLOCK_REALTIME, &se, &handle);
Does anyone know how to make this work?
I'm running on a Sparc station, Solaris 8, gcc-2.95.3.
Regards
[email protected]

Hello-
I believe the problem is the following:
se.sigev_notify = SIGEV_THREAD;
Currently only the only two options for sigev_notify are SIGEV_SIGNAL and SIGEV_NONE. POSIX.4 documentation/books can provide the details for each option. Hope this helps.

Similar Messages

  • Catching POSIX signals with labview

    Hi,
    is there a way to catch POSIX signals with LabVIEW.
    Im building a LabVIEW Client (Linux AND Windows) to a non LV Server
    (Linux, C). All works fine except the catching of the interrupts sent
    by the server. The server sends interupts using POSIX signals. For full
    functionality I should be able to catch this signals. How can I do
    that?
    Thanks for your help
    Ulrich

    Interesting project!
    I looks like a few people have tackled decoding the data (both WWV and WWVB) using reciever modules that create a digital signal stream and Arduinos to decode the data.
    How about GPS based time? Here is reciever/decoder module that provides a decoded serial data stream:
    http://www.parallax.com/Portals/0/Downloads/docs/prod/acc/GPSManualV1.1.pdf
    -AK2DM
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

  • Applescript Studio/XCode - NSPathControl to POSIX file with spaces

    I'm trying to get a value from a NSPathControl in my XIB and change it into a POSIX file, so I can manipulate it in the Finder (make a copy, rename, etc). My code works, but not if there are any spaces in the path. Any spaces are returned as %20, which doesn't translate into a POSIX file. Any ideas?
    script:
    on clicked theObject
    set theFile to (string value of control "sourceXML" of window "main")
    set theFile to (theFile as POSIX file)
    tell application "Finder"
    reveal theFile
    end tell
    end clicked

    Hello
    Since you're using AS Studio, you may use NSString's method to convert %xx notation to character.
    Something like this :
    on clicked theObject
    set f to string value of control "sourceXML" of window "main"
    set f to call method "stringWithString:" of class "NSString" with parameter f
    set f to call method "stringByReplacingPercentEscapesUsingEncoding:" of f with parameter 10
    set f to (f as POSIX file)
    tell application "Finder"
    reveal f
    end tell
    end clicked
    String Encodings constants are as follows. (See NSString's reference for detalis.)
    (I think 10 = NSUnicodeStringEncoding will be fine, but I may be wrong.)
    enum {
    NSASCIIStringEncoding =1,
    NSNEXTSTEPStringEncoding =2,
    NSJapaneseEUCStringEncoding =3,
    NSUTF8StringEncoding =4,
    NSISOLatin1StringEncoding =5,
    NSSymbolStringEncoding =6,
    NSNonLossyASCIIStringEncoding =7,
    NSShiftJISStringEncoding =8,
    NSISOLatin2StringEncoding =9,
    NSUnicodeStringEncoding =10,
    NSWindowsCP1251StringEncoding =11,
    NSWindowsCP1252StringEncoding =12,
    NSWindowsCP1253StringEncoding =13,
    NSWindowsCP1254StringEncoding =14,
    NSWindowsCP1250StringEncoding =15,
    NSISO2022JPStringEncoding =21,
    NSMacOSRomanStringEncoding =30,
    NSUTF16BigEndianStringEncoding =0x90000100,
    NSUTF16LittleEndianStringEncoding =0x94000100,
    NSUTF32StringEncoding =0x8c000100,
    NSUTF32BigEndianStringEncoding =0x98000100,
    NSUTF32LittleEndianStringEncoding =0x9c000100,
    NSProprietaryStringEncoding =65536
    Hope this helps,
    H

  • Posting script code in these forums

    OK, it looks like there are some (new) formatting issues with these forums when people try to post their scripts. I have been using a formatter script that converts the text on the clipboard to HTML and then wraps it in a pre tag, but there still seems to be some issues with certain characters. The following script has worked for me so far (although I don't post that much) - what other scripts or methods work for you?
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">-- script formatter
    property TempFile : "SF_TempFile" -- a temporary work file
    property TheWidth : "width: 720px; " -- a width attribute (deprecated in HTML 4.01)
    try
    set TheClipboard to (the clipboard) as string
    set MyOpenFile to open for access ("/tmp/" & TempFile & ".txt" as POSIX file) with write permission
    set eof of MyOpenFile to 0 -- empty the temp file
    write TheClipboard to MyOpenFile
    close access MyOpenFile
    -- convert to HTML - see man textutil
    do shell script "cd /tmp/; textutil -convert html -excludedelements '(html, head, title, body, p, span, font)' -encoding US-ASCII " & TempFile & ".txt"
    -- strip the first line (<?xml ?>) and add the <pre>...</pre> wrapper
    set TheText to rest of (paragraphs of (read ("/tmp/" & TempFile & ".html" as POSIX file))) as text
    set TheText to "<pre title=\"this text can be pasted into the Script Editor\" style=\"font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; " & TheWidth & "color: #000000; background-color: #E0E0E0; overflow: auto\">" & TheText & "</pre>"
    set the clipboard to TheText
    display dialog ((count TheText) as text) & " characters placed on the clipboard" with title "Script Formatted" buttons {"OK"} default button "OK" giving up after 4
    on error ErrorMessage number ErrorNumber
    display alert "Error " & (ErrorNumber as string) message ErrorMessage as warning buttons {"OK"} default button "OK"
    end try</pre>

    Hello red_menace,
    Indeed a pre-processing code like yours is always an option for us, but from my point of view, the correct solution is for the discussions' admins to disable this meddlesome formatting feature of the new fora software.
    This new feature affects not only new posts but also the existing messages in the fora, that means it has rendered quite a few useful messages totally useless. This is actually serious data loss caused by the thoughtless software. And for what?
    After all, these discussions' boards are not chat rooms where people might want some simple input methods for fancy text formattings, but technical support fora where people frequently post programming codes, computer outputs and so forth that have many reserved symbols and notation.
    I really wish they may fix this promptly.
    Best regards,
    Hiroto

  • Cannot use my Mac Mini server as Time Machine server

    Hello,
    May some one can help me...
    I try to connect clients to a time Machine server, well it's seems to be a bit difficult, I created user's accounts, computers accounts, group of computers... It works for the update services, but after configuring Time Machine on the server, shared in server admin, in Workgroup manager, file sharing, preference pane, user's services... I can see the volume in time machine preferences, but there is always the same issue, first message is "the disk is not reachable" second "there is a probleme with the network name and password" I tried with different posix, ACLS, with user's password, server admin password, directory admin password... Well I'm a bit tired...
    I tried on the server and on a Promise 4To, I can see the shared items folder and the Backups foledr and that the only thing I can do...
    Well if some one can help me it will be great for me and for every body arround me...
    Thanks,
    Nicolas

    Hello Peter,
    Thanks for your answer.
    There must be something wrong in the different steps I follow.
    Firts I set Time machine on the server for each user, shoosing the Volume "SmartStor" (a network volume attached on the Mac Mini server) it creates a "Shared items" folder with a "Backups" folder in.
    In Server Admin tools I can see in the AFP services the share point /Backups
    In Workgroup Manager I set the Time Machine's preferences for the different computers and computers' group with the path afp://myserver.local/Backups/
    At least on my client's computer I can shoose the volume "Backups" "on my server".
    And it doesn't work... even with all the logins and password, User's, Dir Admin and Server Admin.
    With User's and Dir Admin it runs quickly and tells "the volume is not reachable on account of wrong user's name or password"
    With Server Admin login and password it runs indefinitly, nothing occurs ...
    Is there something to do in terminal ?
    Well I tried to find explanations on the web but I found nothing for the moment... The informations are to set a network volume in Terminal in place of the default one...
    'Hope to find soon, I can't stand that something runs for every one but not with me...

  • Leopard Server 10.5.4 + SMB + Windows XP Clients

    Hello!
    I got quite some interesting problems with my Xserv under Leopard Server 10.5.4 with Windows XP Clients.
    The server runs as an open directory master and a standalone server for smb.
    Shares are setup for AFP and SMB clients, ACLs are set up with read+write access for the user's group. So far everything works, users can connect from their Macs (OS X 10.3.x - 10.5.4) without problems.
    My problem are the windows clients.
    Connecting works fine, and apart from one permission bug (more on that later) they can access all files and do everything the macs can do.
    Problem 1:
    Users cannot rename files if they don't have write permission at the POSIX-level as either owner or group on the enclosing folder. ACLs do not matter at this point, if the user connects through SMB he cannot rename files or folders.
    No big problem, I just put all users into one group and set this group as the POSIX-group and do a chmod -R g+w on all shares.
    Inheritate this settings for SMB-connections works.
    But not for AFP-connections. Every new folder a mac-client creates comes with permissions 755. So I changed UMasks on the clients to 002, and at least folders created by the finder now have the right permissions of 775.
    Folders created by "new folder" on most applications load/save dialogs still come as 755 which screws up renaming for windows-clients.
    Folders created when expanding a zip-file also behave this way.
    The only solution I found for this was to make a cronjob that does a chmod -R g+w on the shares. Not that great.
    Another "fun" feature with POSIX-permissions and SMB:
    Files inside a folder. Files+Folder have an ACL set up that specifically denies deleting files+folders for a user. This users group has POSIX-permissions with write access to the enclosing folder. Window's explorer will let that user delete files and folders without any complaint about missing permissions to do so. They even disappear from the explorer-window, but are not actually deleted.
    If you refresh the view, the files+folders are there again.
    If the user instead has no POSIX-permission that grants him write-access, but an ACL that grants him delete, explorer happily deletes the files the user wishes to. And these files actually get deleted.
    If the user has no write POSIX-permission and no ACL-permission to delete files, explorer complains about missing rights to delete files/folders.
    I tried adding "acl check permissions = no" to smb.conf, but that didn't change this behaviour.
    Problem 2:
    Sometimes, when copying "large" files to a server share with windows explorer (from 50 MB upto 3 GB), the user immidiately gets an error message: "Cannot copy. The specified network name is no longer available."
    The copied file shows up at once in the destination directory and has the correct file size, but only contains "garbage". Half a second later the same copy works and the file is actually copied successfully.
    Sometimes this error shows up while a large file is copied and if you browse through other shared folders while the copy takes place.
    Most often it will show up when you copy&paste with explorer.
    I am stomped and have no idea where to search for a solution to this one.
    I tried changing ethernet cables (premade and selfmade), the network switch, ethernet port of the Xserv ... connected a workstation directly to the Xserv - no change.
    DNS works, all clients+Xserv have static IPs and the same settings for DNS-Server. Name resolution works, as does reverse resolution.
    I even tried using a windows server 2003 as a WINS-Server without success for this problem.
    There are no event log entries on the clients when this happens, and smbd.log on the server shows
    read failure for 4 bytes to client 192.168.1.137. Error Connection reset by peer
    I used wireshark to monitor what exactly happens when this shows up, but it just happens out of nowhere ... the clients just sends a TCP_RST. No unusual things before or after the TCP_RST.
    I ran some tests with samba 3.0.32 and samba 3.2.x under linux 2.6.x - no such errors at all.
    I tried installing Leopard Server on my Mac Pro, same behaviour.
    I ran some batch-scripts that would copy large and small files in excess from/to the server from 4 different windows xp clients for a whole weekend 24 hours - not a single error. As soon as I use windows explorer to copy a file this error has a chance of showing itself.
    Problem 3, more of an application bug:
    Adobe InDesign CS2 (Windows again ;)) cannot export a PDF to a shared folder if the filename is longer than 8 characters. It starts exporting and after reaching 100% it just stops with the error "PDF cannot be exported." If the filename is shorter than 8 characters, all works fine. Exporting locally or to other samba servers (linux) or windows servers (2003) works fine. Copying this files to the share works, too.
    Exporting any other filetype from IDCS2 (eps, inx, jpeg ...) works regardless of filename length. So does saving InDesign-files.
    InDesign CS1 and CS3 do not show this, so I guess it's safe to assume this one is Adobe's problem
    Did anyone experience similar problems or even better has a solution to some of these?
    The real showstopper is problem #2, at least for us.
    Thanks in advance and excuse my poor english skills!

    I tried several new approaches, but nothing worked so far.
    The update to 10.5.5 made things worse. Connections are dropping all over the place, when saving from Adobe programs in particular.
    Printing from clients to a Xerox Phaser 5500 works, but choosing a different paper size than the default chosen in the cups admin interface goes all wrong and either prints on the default paper size, but down/upscaled to the chosen paper size or prints on the chosen paper size and down/upscaled as if you were printing to the default paper size. (e.g. default paper size is A4, you choose A3 with an A3 document. Document prints on A4 and is downscaled to A4, or prints on A3 and is downscaled to A4.)
    There is no way I can keep this thing in production much longer. I tried reinstalling again, but that did not change any behaviour. Another nice "feature": InDesign disables "edit original" when the path to the linked file contains any directoryname with more than 8 characters in length.
    Coupled with a sometimes disappearing "dirserv" (it just stops working until I reboot the whole computer) the decision stands to move away from the Xserve.
    Leopard Server 10.5.x just does not seem to work well with windows clients.
    We will migrate to a windows server 2003 running ExtremZ-IP for the macintosh clients this weekend. Too bad that Apple does not allow Bootcamp to work on Xserves, at least the hardware would have been useful then.
    (As a nice finishing touch, the harddisk partition where all data resides did become corrupt over the weekend. "The volume Daten could not be repaired."
    Disk Utility and first aid did show nothing on friday ... saturday after no work being done on the partition this error shows up. The only solution I could find was to reformat the partition and restore from a previous backup. Another weekend down the drain. Sorry for the rant, but 6 weekends in a row is enough.)

  • Inherited Permisions in 10.4.6

    I can seem to get Inherited Permissions to work. Least that's what I think the issue is. The problem is on my fileserver, when clients create a folder it is created with read only access for the staff and read & write for the owner (which is the user that created it. I need them to create files and folders that have Read and Write Access for the Staff Group as well.
    I have set the Permissions at for the Share with the Standard Permissions to Owner, Group, and Everyone = Read and Write. Now the the server is 10.4.6 I have added the Staff Group to the ACL as well, it's the same group from standard, and set permissions to Allow, Full Control, Inherited No, Applies to This, Child and All descendant folders. I propagated the permissions, didn't work. I Made the inherited entries explicit, didn't work.
    What's wrong?

    These two facts will help you out:
    1. Please look at my ACL Tips post. The Tiger permissions model works in one of two ways, and changing the model for a volume requires a restart: you have either POSIX permissions (with either the umask or Inherit Permissions option) or the Effective Permissions model, which uses POSIX permissions and Access Control Lists.
    With ACLs disabled on the volume in question, the permissions model relies solely on the POSIX owner, group, and everyone fields. POSIX permissions are determined for new files by using the subtracting the last three bits of the umask from 777. Normally, the umask value is 0022, so this yields default permissions of 755 (for new folders) and 644 (for new files, minus the execute bit). Unless set-UID and set-GID bits are used (special POSIX permissions), the owner name is set to the user who performs the new folder/file creation, and the group name is set to that user's primary group.
    Classically, AFP 2.x and 1.x have not used a POSIX permissions model. The model used in 2.x was close to POSIX permissions, but the major difference was that new file permissions were not calculated via umask; rather, they were inherited from their enclosing folder. This model doesn't do much for security, but there are situations where it is useful. To overcome this, Apple introduced the Inherit Permissions option via POSIX access in Mac OS X Server 10.2.
    Inherit Permissions should continue to work in Mac OS X Server 10.4, but this option requires that you use the POSIX-only permissions model, so you'll have to disable ACLs on the volume in question, restart, then reapply POSIX permissions accordingly. The downfall of "Inherit Permissions from parent" is that it isn't always clear what "the parent" is. Most people want "the parent" to be the top-level of the share point, but it's actually the enclosing folder, which may be different for different files and folders. This means that you can only inherit the permissions assigned to the enclosing folder, and you have no option to push different permissions forward to contents. In short, this model is not well-defined and quite limited due to its global nature with respect to share points.
    A better solution would be to use the Effective Permissions model. Effective Permissions returns permissions calculated from both POSIX permissions and applicable Access Control Lists. See my ACL Tips post for details on how to use Effective Permissions (http://discussions.apple.com/thread.jspa?messageID=1535247). POSIX permissions are still assigned via the POSIX umask, but ACLs have their own inheritance model. The real benefit is that the file_inherit and directory_inherit controls supported by ACLs are more flexible than using the "Inherit Permissions from parent" POSIX hack: By inspecting the ACLs of a parent (enclosing) folder, you can know immediately which entries apply to the folder or its contents, or both; thus, it's well-defined. Further, you can have some folders inherit permissions and others not, so the change isn't global to the share point.
    2. When using either the Effective Permissions model or the POSIX permissions (with "inherit from parent" selected), permissions are only inherited forward to new files and folders, not existing ones. A new file or folder is defined as follows: any folder created in the share point, any file saved in it, or anything copied to it.
    To change POSIX permission bits and ACL entries for existing files and folders (those already in the share point), you'll need to use chmod with the recursive (-R) argument. You can change the POSIX owner name and POSIX group name similarly with chown.
    Hope this helps.
    --Gerrit

  • Search for text and font

    I have an 800 page pdf document to index and so far I have a script that will search for a list of keywords. But the text has large sections of code in a different font, and I think we would like to generate an index of just code examples. Is there a way to search for text of a given font in applescript? Something like
    set theSel to find text theText
    if the font of theSel is "Times"
    write to file, etc.

    Please do send a page, I might be able to spot where the font problem is coming from - but no guarantee Address is in my profile.
    You asked about the script formatter. red_menace of this forum wrote the script I use. To use it, you copy the script that you want to format to the clipboard and run the formatter. This then places the marked-up text in the clipboard so that you can paste it into the forum page.
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;">
    script formatter - formats the clipboard text for forum posting
    last reviewed January 19, 2009   red_menace[at]mac[dot]com
    Input: text read from the clipboard
    Output: formatted text copied to the clipboard
    set AppleScript's text item delimiters to " "
    -- some constants and switches
    property TextColor : "#000000" -- black  (see http://www.w3schools.com/tags/ref&#95;colornames.asp)
    property BackgroundColor : "#FFDDFF" -- a light plum/purple
    property BorderColor : "#000000" -- black
    property TheWidth : "width: 720px; " -- a width attribute  (deprecated in HTML 4.01)
    property UseWidth : true -- use the width attribute?
    property LineCount : 25 -- the number of lines before including the height attribute
    property TheHeight : "height: " & ((LineCount * 13.6) as integer) & "px; " -- a maximum height for the <pre> box
    property Emphasize : false -- emphasise (bold) the script text?
    property UseURL : false -- include a Script Editor message link?
    property AltURL : false -- use an alternate URL encoding?
    property ToolTips : {¬
    "this text can be pasted into the Script Editor", ¬
    "this text can be pasted into an Automator 'Run AppleScript' action", ¬
    "this text can be pasted into an Automator 'Run Shell Script' action", ¬
    "this text can be pasted into a HTML editor", ¬
    "this text can be pasted into a text editor", ¬
    "- none -"}
    property TooltipDefault : {item 1 of ToolTips} -- keep track of the last tooltip used
    property TempFile : "Script_Formatter_TempFile" -- a temporary work file
    try
    -- write the clipboard to the temporary file
    set TheClipboard to (the clipboard) as text
    if TheClipboard is in {"", space, tab, return} then return -- clipboard is (basically) empty
    set MyOpenFile to open for access ("/tmp/" & TempFile & ".txt" as POSIX file) with write permission
    set eof of MyOpenFile to 0 -- empty any previous temp file
    write TheClipboard to MyOpenFile
    close access MyOpenFile
    if UseURL then
    -- encode URL  (see http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/pydoc.1. html)
    do shell script "/usr/bin/python -c 'import sys, urllib; print urllib.quote(sys.argv[1])' " & quoted form of TheClipboard
    -- add a link wrapper
    set URLtext to "applescript://com.apple.scripteditor?action=new&script=" & the result
    if AltURL then -- use an alternate URL encoding
    set URLtext to "Click here to [url=" & URLtext & "]open this script in the Script Editor[/url]:<br />"
    else -- use HTML anchor tag
    set URLtext to "Click here to <a href=\"" & URLtext & "\">open this script in the Script Editor</a>:<br />"
    end if
    set PromptText to ((count URLtext) as text) & " URL and "
    else
    set {URLtext, PromptText} to {"", ""}
    end if -- UseURL
    -- convert to HTML  (see http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/textutil .1.html)
    do shell script "cd /tmp/; /usr/bin/textutil -convert html -excludedelements '(html, head, title, body, p, span, font)' -encoding US-ASCII " & TempFile & ".txt"
    -- fix up some formatting and add a pre wrapper  (see http://www.w3schools.com/tags/default.asp)
    set HTMLtext to rest of paragraphs of (read ("/tmp/" & TempFile & ".html" as POSIX file))
    if (count HTMLtext) is less than LineCount then -- skip the height attribute
    set Height to ""
    else
    set Height to TheHeight
    end if
    set HTMLtext to FixCharacters from (HTMLtext as text) -- additional character encodings
    if UseWidth then
    set Width to TheWidth
    else
    set Width to ""
    end if
    if Emphasize then set HTMLtext to "<strong>" & HTMLtext & "</strong>"
    set HTMLtext to "<pre style=\"
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid " & BorderColor & ";
    " & Width & Height & "
    color: " & TextColor & ";
    background-color: " & BackgroundColor & ";
    overflow: auto;\"
    title=\"\">
    " & HTMLtext & "</pre>
    -- assemble everything on the clipboard
    set TheResult to choose from list ToolTips ¬
    with title "Script Formatted" with prompt PromptText & ((count HTMLtext) as text) & " HTML characters will be placed on the clipboard (plus the following ToolTip):" default items TooltipDefault OK button name "OK" cancel button name "Cancel" with empty selection allowed without multiple selections allowed
    if TheResult is false then -- cancel button
    error number -128
    else -- add the selected title attribute (tooltip), if any
    set TooltipDefault to TheResult as text
    set Here to (offset of " title=" in HTMLtext) - 1
    set There to (offset of ">" in HTMLtext) - 1
    if TheResult is in {{}, "- none -"} then -- no tooltip
    set the clipboard to URLtext & (text 1 thru (Here - 1) of HTMLtext) & (text (There + 1) thru -1 of HTMLtext)
    else
    set the clipboard to URLtext & (text 1 thru (Here + 9) of HTMLtext) & TheResult & (text There thru -1 of HTMLtext)
    end if
    end if -- TheResult is false
    on error ErrorMessage number ErrorNumber
    log space & (ErrorNumber as text) & ":" & tab & ErrorMessage
    try
    close access MyOpenFile
    end try
    if (ErrorNumber is -128) or (ErrorNumber is -1711) then -- nothing (user cancelled)
    else
    activate me
    display alert "Error " & (ErrorNumber as text) message ErrorMessage as warning buttons {"OK"} default button "OK"
    end if
    end try
    to FixCharacters from TheText
    fixes (converts) formatting characters used in some message forums  (see http://www.asciitable.com/)
    parameters - TheText [text]: the text to fix
    returns [text]: the fixed text
    -- this list of lists contains the characters to encode - item 1 is the character, item 2 is the HTML encoding
    set TheCharacters to {¬
    {"!", "&#33;"}, ¬
    {"*", "&#42;"}, ¬
    {"+", "&#43;"}, ¬
    {"-", "&#45;"}, ¬
    {"[", "&#91;"}, ¬
    {"\\", "&#92;"}, ¬
    {"]", "&#93;"}, ¬
    {"^", "&#94;"}, ¬
    {"_", "&#95;"}, ¬
    {"~", "&#126;"}}
    set TempTID to AppleScript's text item delimiters
    repeat with SomeCharacter in TheCharacters
    if item 1 of SomeCharacter is in TheText then -- replace
    set AppleScript's text item delimiters to item 1 of SomeCharacter
    set the ItemList to text items of TheText
    set AppleScript's text item delimiters to item 2 of SomeCharacter
    set TheText to the ItemList as text
    end if
    end repeat
    set AppleScript's text item delimiters to TempTID
    return TheText
    end FixCharacters
    </pre>

  • Error Building DBXML-2.5.16 in Solaris 10 (SPARC)

    Hi all,
    I'm trying to build dbxml-2.4.16 from source in my Solaris 10 machine. Compilation starts well and goes on, but Berkeley-DB build fails with the following error
    make: *** [libdb-4.6.la] Error 1
    Here is my setup details.
    bash-3.00# uname -a
    SunOS WBTURGO02 5.10 Generic_137137-09 sun4v sparc SUNW,Netra-T5220
    bash-3.00# gcc -v
    Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs
    Configured with: ../configure with-as=/usr/ccs/bin/as with-ld=/usr/ccs/bin/ld enable-shared enable-languages=c,c++,f77
    Thread model: posix
    gcc version 3.4.6
    bash-3.00# g++ -v
    Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs
    Configured with: ../configure with-as=/usr/ccs/bin/as with-ld=/usr/ccs/bin/ld enable-shared enable-languages=c,c++,f77
    Thread model: posix
    gcc version 3.4.6
    bash-3.00# make -v
    GNU Make 3.82
    Built for sparc-sun-solaris2.10
    Copyright (C) 2010 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    And, the command that I used to trigger the build is
    bash-3.00# cd /export/home/kaja/BDB/dbxml-2.4.16
    bash-3.00# ./buildall.sh -p solaris -c gcc -x g++ -m make prefix=/export/home/kaja/BDB/Install-2.4.16 enable-java with-dbxml=/export/home/kaja/BDB/dbxml-2.4.16/dbxml with-berkeleydb=/export/home/kaja/BDB/dbxml-2.4.16/db-4.6.21 with-xerces=/export/home/kaja/BDB/dbxml-2.4.16/xerces-c-src with-xqilla=/export/home/kaja/BDB/dbxml-2.4.16/xqilla
    Is there anything I'm missing or I have gone wrong? Please help me. I want to build bdb-xml with Java support.
    Thanks in advance,
    With regards,
    R Kaja Mohideen
    Edited by: mail4kaja on Sep 1, 2010 8:07 PM - Modified Title to DBXML-2.5.16

    Hi all,
    I have tried using that -xarch=v9 in my build. But, that didn't help me. So, I just though of using the latest BDBXML hoping that it will support me.
    I want to build BDBXML-2.5.16 that will be used my two applications (C++ & Java).
    C++ Application will create environment, containers and put documents in the containers.
    Java Application will read/query the document contents.
    My machine details.
    uname -a
    SunOS ltesol1 5.10 Generic_137111-03 sun4u sparc SUNW,Sun-Fire-480R
    cc -V
    cc: Sun C 5.9 SunOS_sparc Patch 124867-09 2008/11/25
    CC -V
    CC: Sun C++ 5.9 SunOS_sparc Patch 124863-05 2008/06/03
    make --version
    GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
    Built for sparc-sun-solaris2.9
    Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
    Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.
    Report bugs to <[email protected]>.
    Following are the commands I have used to trigger my BDBXML-2.5.16 build.
    export CFLAGS="-I/usr/jdk/instances/jdk1.5.0/include -I/usr/jdk/instances/jdk1.5.0/include/solaris"
    export CXXFLAGS="-library=stlport4 -library=Crun -I/usr/jdk/instances/jdk1.5.0/include -I/usr/jdk/instances/jdk1.5.0/include/solaris"
    ./buildall.sh prefix=/var/tmp/a22189/kaja/Install-2.5.16 -c cc -x CC enable-java with-dbxml=/var/tmp/a22189/kaja/dbxml-2.5.16/dbxml with-berkeleydb=/var/tmp/a22189/kaja/dbxml-2.5.16/db-4.8.26 with-berkeleydb-conf="enable-posixmutexes with-mutex=POSIX/pthreads" with-xerces=/var/tmp/a22189/kaja/dbxml-2.5.16/xerces-c-src --with-xqilla=/var/tmp/a22189/kaja/dbxml-2.5.16/xqilla
    And, I'm getting the following xerces linking issue
    Undefined first referenced
    symbol in file
    bool xercesc_3_0::DOMLSSerializerImpl::canSetParameter(const unsigned short*,bool)const .libs/XPath2NodeSerializer.o
    bool xercesc_3_0::DOMLSSerializerImpl::canSetParameter(const unsigned short*,const void*)const .libs/XPath2NodeSerializer.o
    void xercesc_3_0::DOMLSSerializerImpl::setParameter(const unsigned short*,bool) .libs/XPath2NodeSerializer.o
    void xercesc_3_0::DOMLSSerializerImpl::setParameter(const unsigned short*,const void*) .libs/XPath2NodeSerializer.o
    const void*xercesc_3_0::DOMLSSerializerImpl::getParameter(const unsigned short*)const .libs/XPath2NodeSerializer.o
    ld: fatal: Symbol referencing errors. No output written to .libs/libxqilla.so.5.0.2
    make[1]: *** [libxqilla.la] Error 1
    make[1]: Leaving directory `/var/tmp/a22189/kaja/dbxml-2.5.16/xqilla/build'
    make: *** [all-recursive] Error 1
    Please help me resolve this build issue.
    Thanks & regards,
    R Kaja Mohideen

  • Finder + ACLs over AFP Mounted Remote Volume

    Hey Guys!
    My Finder is not able to display ACLs on files coming from an AFP mounted volume. The ACLs are there -- ``ls -lef'' displays them correctly. If there some obvious thing here that I'm missing?
    regards,
    P

    Yes, sort of. Whenever you're doing an "opportunistic mount" where the server and client are not joined to the same directory domain, permissions masking will take place. When masking is in effect, it maps access from the currently logged-in user (session owner) on the client to the server share point based on the name and password entered after choosing Go > Connect to Server.
    When dealing with masked permissions, this will be the case:
    * On the client-side, the Finder Info windows may or may not correctly show all ACLs and POSIX permissions of items on the share point. They may simply display effective access - e.g. "you can only read" - without further detail. This depends on the protocol. Typically AFP share points will show correct server-side ACLs and POSIX permissions.
    * On the client-side, listing (ls) the contents of the share point via Terminal will indicate that the session owner has full control and is the "POSIX owner" with others' access at zero (0700). These are the masked permissions, not the real ones.
    * On the server, permissions listed via ls in Terminal or Server Admin's File Sharing section will be the correct ones.
    --Gerrit

  • ACL Tips version 2

    The following is a more concise version of my ACL tips post, with some relevant and updated answers for 10.4.4.
    Before You Begin: I recommend starting with Mac OS X Server 10.4.3 minimum. Some quirkiness in the ACL model exists in earlier versions of Mac OS X Server 10.4. Also, be sure to check all of your volumes with Disk Utility's Repair function before proceeding. ACL information is stored in the Extended Attributes file, and damage to that file can cause confusion when setting or changing permissions.
    The Tiger Permissions Model: Mac OS X Server version 10.4 supports standard UNIX (POSIX) permissions and Access Control Lists (ACLs). ACLs offer some options previously unavailable in earlier versions of the server software, and can be used to define permissions for newly created files and folders. You don't have to use ACLs, though: When disabled, the permissions model simply relies on POSIX permissions, just as with Mac OS X Server 10.3 and earlier. When ACLs are enabled, Mac OS X Server considers ACL information and POSIX information. This consideration process returns the Effective Permissions for a particular file or folder (filesystem object).
    The ACL model Apple uses is identical to the model used by Microsoft Windows; however, there is no "ACL only" option that will ignore POSIX permissions. You either have POSIX only (with ACLs disabled), or both (Effective Permissions).
    ACLs are enabled on a per-volume basis. You can do so in the Sharing section of Workgroup Manager by clicking the All tab and navigating to an HFS+ volume in the list. Or, you can do so from the command line with fsaclctl.
    Effective Permissions: When ACLs are enabled, the Effective Permissions are calculated in the following way:
    (relevant POSIX permissions) union (relevant ACL Allow entries) take away (relevant ACL Deny entries)
    This means that applicable POSIX permissions (either owner, group, or POSIX everyone) and applicable ACL Allow entries are combined to grant the connecting user access to the filesystem object. If no ACL Deny entries apply to the connecting user, then the Effective Permissions for the user accessing the filesystem object are simply the union of applicable POSIX and ACL Allow entries. If an ACL Deny entry applies to the connecting user, then that level of access is not granted for the filesystem object.
    In this way, the ACL Deny entry has the most power. When specified, it overrides any ACL Allow rule or POSIX permission bit.
    Applicable POSIX Permissions: The POSIX permissions for a connecting user accessing a filesystem object are determined using the following method. Remember, POSIX permissions are applicable when ACLs are disabled and when they are enabled (as part of the Effective Permissions model).
    POSIX permissions consist of three "fields": an owner which must be assigned to a user, a group, and an everyone else category. Sometimes each category is referred to as a POSIX permission bit, and the everyone else field may be referred to as "world," since those are the permissions assigned to any user who cannot be categorized as the filesystem object's owner or group member.
    Each POSIX permission field can have zero, one, two, or three of three bits enabled, which determine eight different levels of access: read, write, and execute (for files, launch/open; for folders, view contents). Each is called a bit because together they represent a three-bit number ranging from 0 (binary 000) to 7 (binary 111), where read=4 (binary 100), write=2 (binary 010), and execute=1 (binary 001). As you can see, this allows eight different combinations for eight different access levels:
    No access = 0 (000)
    Execute only = 1 (001)
    Write only = 2 (010)
    Write & Execute (Drop Box) = 3 (011)
    Read only = 4 (100)
    Read & Execute =5 (101)
    Read & Write = 6 (110)
    Read, Write, and Execute = 7 (111)
    If the connecting user is the filesystem object's owner, then he/she receives the POSIX permissions assigned to the owner of the filesystem object. If and only if that fails, then Mac OS X checks to see if the connecting user should be assigned the POSIX permissions assigned to the filesystem object's group. (First it checks to see if the connecting user's primary group matches that of the group assigned to the filesystem object; if there's no match, then it looks up the filesystem object's group to see if the connecting user is a member.) If and only if the group assignment fails, then the connecting user is assigned the POSIX permissions of the everyone else category. If all fail, then no access is returned.
    In this way, the POSIX permissions are either those assigned to the owner, group, or everyone else category; if more than one is true for the connecting user, then the first item that is true determines the POSIX permissions returned. In other words, owner overrides group, and group overrides everyone else.
    Everyone else doesn't necessarily mean guest. In fact, guest access is only available if it has been enabled for the AFP or SMB services using Server Admin. Often guests do receive the permissions assigned to the everyone else group, unless you use the group named "everyone" (GID 12) in the POSIX group field when assigning it to a filesystem object. Since this is redundant, the "everyone" group is more useful with ACLs.
    Setting POSIX Permissions and New File & Folder Behavior: Each filesystem object has three (normally) or four (for special modes) POSIX permission fields attached to it. The permissions for owner, group, and everyone else are often abbreviated using the decimal form of each permission. For example, 773, means owner can read, write, and execute (7), group can do the same, and everyone else can read and execute (drop box) only. An owner name and group name are attached to the filesystem object by the UID and GID of each.
    Normally, the POSIX model always applies a default set of permissions calculated by using the umask to newly created files and folders. This is called "standard POSIX behavior" or "standard UNIX behavior". By default the umask is 0022, which means that newly created files receive permissions of 755. The only thing that changes are the owner and group permission field names. The owner is set to the user who created (or duplicated or copied) the file or folder, and the group is set to that user's primary group (which is staff for most users).
    You can change the way that the POSIX model applies permissions to newly created files and folders:
    * You can set the set-UID or set-GID bits to define a specific owner or group for newly created files. (See man chmod for details.)
    * When ACLs are disabled, you can enable the "Inherit Permissions" access option. In this case, the permission fields and bits are inherited from their enclosing folder. This option is disabled with ACLs, because ACLs provide a more robust model for permission inheritance.
    continued

    The chmod commands you shared set the ACL for read-write, correct? Correct. The command listed in the last post will apply read & write controls for the gsc group, adding file and folder inheritance to any newly-created enclosed objects. To set full control, you simply need to add two more controls to the list: chown and writesecurity:
    sudo chmod +a "gsc allow readsecurity,readattr,readextattr,list,serch,read,execute,writeextattr,writeatt r,delete,deletechild,add_file,add_subdirectory,write,append,file_inherit,directoryinherit,chown,writesecurity" /Volumes/Data/Shared
    The major difference between all read and write controls and the full control set of controls is that full control would enable your gsc group to dynamically change permissions for any files onto which its ACL entry allows it, along with the ability to change the file's POSIX owner (which is less important, unless you want to change the user who originally created/copied the file in/to the folder).
    Also, if I give 2 users "full-control" as defined by an ACE for a shared folder, and one of the users creates a file within the shared folder, does the fact that they have "full-control" mean that any files they create will have the default umask and that the other user wouldn't be able to open it, even though they too have "full-control"?
    As long as both users have full control to the file or folder in question, it doesn't matter what POSIX permissions are returned. The POSIX owner, group, and permissions don't have to be set such that one is the owner. Remember that Effective permissions take POSIX permissions and ACLs into consideration. In fact, POSIX access could be set to 000, returning no access, so long as an ACL for full control is present (and no ACL deny rules apply), the user or group would have full control.
    New files created in a folder will still have their owners set to the creating user, their groups set to the creator's primary group, and their permissions set as per the umask (resulting in 755 by default). However, these are all POSIX permission model items, and that's just 1/3 of the Effective Permissions picture. If the enclosing folder has an ACL entry with inheritance that grants a specific user or group access, then that ACL will be inherited to the newly-created file, regardless of who creates it.
    Let's say that /Volumes/Data/Shared has the full control ACL for gsc set with inheritance as specified in my last command. Let's say that Sally and Bob are members of the gsc group. Both have their primary groups set to Users (staff), which is the default.
    Bob then creates a new file in (or copies a new file into) /Volumes/Data/Shared: "bob-file.txt" The permissions for /Volumes/Data/Shared/bob-file.txt will show the following: owner: Bob, group: staff, POSIX permissions: 755, ACL for gsc allows full control for that group. Thus, Sally has full control for bob-file.txt, even though she isn't the file's owner.
    However, if you've omitted the file_inherit (or directory_inherit) control for the /Volumes/Data/Shared folder, the situation changes. Any file that Bob creates will not have an ACL entry inherited. Thus, even though both Bob and Sally have full control (as granted by the ACL entry for the gsc group) for the /Volumes/Data/Shared folder, the file bob-file.txt will be read-only for Sally. (Sally can still duplicate or delete it since she has full control for its parent folder, but she cannot simply double-click it and modify it. Read/write control would grant her that ability, too.)
    The ability to change permissions and ownership comes with full control. This operates independently from inheritance, and I recommend using full control with caution, as each user with that ability can modify permissions from their default inherited ACL entries, potentially taking away permissions for other users. Full control for a folder allows the user/group to be an "administrator" for that folder.
    --Gerrit

  • Strange file permissions, I am being asked to authenticate when i own file

    I cannot delete or move a file owned by me with read write permissions without entering password. Could anybody help me figure out why? I have verified and repaired permissions on my disk, file is owned by me in group staff, perms set to 644 and located in my home directory. I could easily enter my password but im curious why this file wont do as its told, any help would be grateful.

    If you didn't want to fix your problem, why'd you ask?
    There is more to permissions than the posix ones you see in Get Info. There are other restrictions in the form of ACLs which cause all sorts of problems if they get assigned where not needed.
    You can view the ACLs along with the Posix permissions with this command:
    ls -ale ~/
    That will display everything in your home folder.
    It sounds as though something is either denying your ability to delete from that folder, or the destination folder is preventing you from writing.

  • Partition Failed Partition failed with the error: POSIX reports: The operation couldn't be completed. CAN NOT ALLOCATE MEMORY

    I plug usb mass storage device to my macbook pro i7 than every thing is stack and i reinforce to shutdown and than I start again but mac fail to boot again.
    I tried different optiones in disk utility in mac os startup disk. but still fail to repair, erase and partition. I try to fix with the steps listed in
    https://discussions.apple.com/message/13288923#13288923
    but it fail to partition with the msg:
    Partition Failed
         Partition failed with the error: POSIX reports: The operation couldn’t be completed.cannot allocate memory
    pls pls pls help urgentely on this matter I stop working.
    Kind Regards,
    pe

    Hi again OGELTHORPE.
    I've already run two hardware tests. One quick one and one extended one. It was unable to pick anything up.
    It's like everything is running perfectly, but when I go to erase the HDD or partition it, it pops up with the error message. Even when I try to erase and partition using "Terminal", I received the same error message.
    It's beginning to do my head in, but will see if replacing the SATA cable will make any difference. If it doesn't, I'll hazard a guess it could be the Logic Board.
    Thanks again for your suggestions!
    L.

  • Any help with picking POSIX file to display

    So I ran this script to read out a text file
    set examplefile to {}
    set linesf to paragraphs of (read POSIX file (choose file))
    repeat with nextline in linesf
              if length of nextline > 0 then
                        copy nextline to the end of linesf
              end if
    end repeat
    set textfileread to result
    display alert textfileread
    But I get this error
    error "Can’t make POSIX file (alias \"Macintosh HD:Users:Stephen:Desktop:encrypt.txt\") into type file." number -1700 from POSIX file (alias "Macintosh HD:Users:Stephen:Desktop:encrypt.txt") to file
    Any Ideas on how I can fix this problem?

    Use:
    set linesf to paragraphs of (read (choose file))
    You don't need to get the POSIX path of something if you're not going to use it in a do shell script command.
    (71173)

  • I get the following error when formatting a external hard drive. Partition failed with the error:  POSIX reports: The operation couldn't be completed. Cannot allocate memory

    I get the following error when formatting a external hard drive.
    Partition failed with the error: 
    POSIX reports: The operation couldn’t be completed. Cannot allocate memory
    I have a Macbook pro 13" A1278. I purchased it around december 2010. I have a HHD 3.5" drive desktop select II 1.5TB. I purchased it around Febuary/March 2011 to use with my Macbook pro. I formatted it and moved all my files to there, I got it so my macbook's hard drive wouldn't brake and I lose everything on my macbook.
    Is there any fixes?

    First, try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until the screen blacks out or you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."

Maybe you are looking for

  • Why do I get Error 42 when I build a RT-exe with numbers in the Target file?

    I can build a RT-exe without numbers in the Target Filename without any problems. As soon as I put a number in the Target Filename, lets say startup1.rtexe, I get the following error: Fehler 42 ist bei Ordner erstellen in Create Directory Recursive.v

  • Cannot play music purchased under old apple id after new hard drive installed

    Replaced crashed HD and used Time Machine to restore to 10.7.5. Had changed my Apple ID a while backe (couple months). Now music purchased with old ID will not play, asking me to authorize under old ID, have no idea what the password was and the emai

  • Fillable Form - Can't use in Reader

    I've developed a fillable form that I saved to be able to access in reader.  Unfortunately, it doesn't seem to be working.  Here's a link... http://www.blocaldetroit.com/wp-content/uploads/2014/01/Just-Baked-F04_distributed_0001.pd f Can someone help

  • Unload FLV movies when clicking home

    Is there a way to set up an unload FLV actionscript (AS3) on the click of a home button? So, when defining the functions of the home_btn, have it unload FLV (sound and video). Or would it be better to put into the actionscript frame? So, when the hom

  • Getting rm-1500 that came with audigy4 to work with other applicati

    Hello all I've done a search and not come up with much, well that was helpful or recent so thought i'd post. I have an Audigy 4 sound card (can't see any other names so it's not a pro or platinum or anything else - just a bog standard audigy 4) it's