Multidmedia Limited (MDM)
Search
advanced search »    
Quick Links
advanced search »
   Tuesday September 7th 2010

 




Untitled Document
+
Products & Solutions
 
Products
- Zinc 3.0 Builder
- Zinc 3.0 Plug-In Windows
- Zinc 3.0 Plug-In Mac OSX
- Zinc 3.0 Plug-In Linux
- Zinc 3.0 Development Suite
- Inferno 1.0 Windows
- Inferno 1.0 Mac OSX
Solutions
- Developers
- Designers
- Education
   
+
Support & Resources
 
Support
- Support Home
- Technotes & Known Issues
- FAQs
- Contact Us
Resources
- Software Updates
- Software Release Notes
- Software Bug Management
- Developer Articles
- File Exchange
- LiveDocs
- Support Forums
   
+
Purchase Online
 
- Online Shop
- Find a Reseller
- Volume Licensing
   
+
Company
 
- About Multidmedia (MDM)
- Client Showcase
- Legal Information
- Job Opportunities
- Press Room
- Blog
   
 

breadcrumbs

Home > Support > Bugs

 

Software Bug Management & Tracking

The MDM Software Bug Management and Tracking System is used to track and monitor the progress of user reported software bugs. You can search for a reported issue below to track it's progress and/or to get more information on an outstanding technical issue.


Bug Report #ZNC-3135FE
Verified on 22 December 2009
mdm.Process.create(...) returns incorrect pid (process id) on Mac OSX  
Reported By Staff Member
This issue is Pending and is marked as a Medium priority.
 
Zinc 3.0 > Mac OSX > Wrapper/Projector > 3.0.18 > Incorrectly Functioning  
Description
mdm.Process.create(...) should return pid (process id) of process that was started by running that method.
For example running "open -b com.apple.Safari" should open instance of Safari browser - and it is assumed that its pid should be returned. That pid could be later used to monitor started process status.

In current build the process id returned is pid of shell process invoked by mdm.Process.create - not pid of process that was started as results of using shell integration.
For example if pid is 3049 then it will be because it is pid of underlying process:

kacper 3049 0.0 0.1 2448756 3332 ?? Rs 1:43PM 0:00.02 /usr/bin/open -g -b com.apple.TextEdit


To repeat please use provided sources and build OS X project and run.

The project is based on code:


applicationComplete="mdm.Application.init(this);">

import flash.utils.setTimeout;
import mdm.*;
// will hold number (process id/pid)
private var processID:Number = -1;
/**
* open TextEdit.app behind application
* record process ID returned by method for future use
* To use below code correctly make sure that TextEdit instance
* is closed
*/
private function openTextEdit():void
{
mdm.Process.setParams("-g", "-b", "com.apple.TextEdit");
processID = mdm.Process.create("My Title", 0, 0, 500, 600, "", "/usr/bin/open", "/usr/bin", 3, 4);
output.text += "processID returned is: "+processID+"\n";
// now we should have processID,
// so let's grab terminal output for process lists for TextEdit
getPidsList();
// use little delay to make sure that process is already up and running
setTimeout(getPidsList, 500);
}
private function getPidsList():void
{
// the output should be similar to:
// processID returned is: 2835
// list pids using ps aux | grept TextEdit
// kacper 2836 6.8 0.3 2762200 8324 ?? S 1:31PM 0:00.08 /Applications/TextEdit.app/Contents/MacOS/TextEdit -psn_0_516222
// kacper 2839 0.0 0.0 2425520 168 ?? R 1:31PM 0:00.00 grep TextEdit
// kacper 2837 0.0 0.0 2435464 640 ?? Ss 1:31PM 0:00.01 /bin/sh -c ps aux | grep TextEdit
mdm.MacShell.exec("ps aux | grep TextEdit");
var outputStr:String = mdm.MacShell.output;
output.text += "list pids using ps aux | grept TextEdit"+"\n";
output.text += outputStr;
}
]]>






Expected behavior is that mdm.Process.create(...) should return pid of resulting process.

There are work arounds available depending on what exact use of pid was planned.
For example one could use AppleScript to check if started application is still running:

var CR:String = "\r";
var TAB:String = "\t";
var LF:String = "\n";
var script:String = "set isRunning to false"+CR;
script += "if appIsRunning(\"Safari\") then"+CR;
script += TAB+"set isRunning to true"+CR;
script += "end if"+CR;
script += "return get isRunning"+CR;
script += "on appIsRunning(appName)"+CR;
script += TAB+"tell application \"System Events\" to (name of processes) contains appName"+CR;
script += "end appIsRunning"+CR;
mdm.AppleScript.setScript(script);
mdm.AppleScript.compileScript();
mdm.AppleScript.run();
var outputStr:String = mdm.AppleScript.getResult();
var isRunning:Boolean = new Boolean(outputStr == "true");
Attached File(s)
Click Here to download the Attached File
Resolution
Pending

View all Pending Bug Reports » Report a new Software Bug/Issue »

 

 
Multidmedia Limited (MDM)

AddThis Social Bookmark Button
Copyright © 2002-2010 Multidmedia Limited (MDM) All rights reserved. Use of this website signifies your agreement to the Terms of Use.
Flash, Flex and associated Logos are the Registered Trademarks of Adobe Systems, Inc.
There are currently 35 Users Online.