Index: /trunk/ippTools/src/Makefile.am
===================================================================
--- /trunk/ippTools/src/Makefile.am	(revision 6219)
+++ /trunk/ippTools/src/Makefile.am	(revision 6220)
@@ -16,5 +16,5 @@
     p2searchRawFrames.c \
     p2updatePending.c \
-    p2writePendingFrames.c \
+	pxframes.c \
     pxtables.c
 
Index: /trunk/ippTools/src/chiptool.c
===================================================================
--- /trunk/ippTools/src/chiptool.c	(revision 6219)
+++ /trunk/ippTools/src/chiptool.c	(revision 6220)
@@ -61,7 +61,7 @@
         return false;
     }
-    bool status = p2writePendingFrames(config, pendingFrames);
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "p2writePendingFrames() failed");
+    bool status = p2PendingFramePrint(stdout, config, pendingFrames);
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "p2PendingFramePrint() failed");
         return false;
     }
@@ -143,7 +143,7 @@
         return false;
     }
-    bool status = p2writePendingFrames(config, pendingFrames);
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false,"p2insertPendingFrames() failed");
+    bool status = p2PendingFramePrint(stdout, config, pendingFrames);
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false,"p2PendingFramePrint() failed");
         return false;
     }
Index: unk/ippTools/src/p2writePendingFrames.c
===================================================================
--- /trunk/ippTools/src/p2writePendingFrames.c	(revision 6219)
+++ 	(revision )
@@ -1,27 +1,0 @@
-#include "pxtools.h"
-
-// select pending frames (exposure+images) which are done/not done
-bool p2writePendingFrames (pxConfig *config, psArray *frames) {
-    PS_ASSERT_PTR_NON_NULL(config, false);
-    PS_ASSERT_PTR_NON_NULL(frames, false);
-
-    fprintf (stdout, "# exp_id class class_id url\n");
-
-    for (int i = 0; i < frames->n; i++) {
-        p2PendingFrame *frame = frames->data[i];
-        PS_ASSERT_PTR_NON_NULL(frame, false);
-        PS_ASSERT_PTR_NON_NULL(frame->images, false);
-
-        for (int j = 0; j < frame->images->n; j++) {
-            p2PendingImfileRow *image = frame->images->data[j];
-            fprintf (stdout, "%s %s %s %s\n",
-                image->exp_id,
-                image->class,
-                image->class_id,
-                image->url
-            );
-        }
-    }
-
-    return true;
-} 
Index: /trunk/ippTools/src/pxframes.c
===================================================================
--- /trunk/ippTools/src/pxframes.c	(revision 6220)
+++ /trunk/ippTools/src/pxframes.c	(revision 6220)
@@ -0,0 +1,37 @@
+#include <stdio.h>
+
+#include "pxtools.h"
+
+bool p2PendingFramePrint(FILE *stream, pxConfig *config, psArray *frames)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+    PS_ASSERT_PTR_NON_NULL(frames, false);
+
+    fprintf (stdout, "# exp_id class class_id url\n");
+
+    psMetadata *pendingmd = psMetadataAlloc();
+    for (int i = 0; i < frames->n; i++) {
+        p2PendingFrame *frame = frames->data[i];
+        PS_ASSERT_PTR_NON_NULL(frame, false);
+        PS_ASSERT_PTR_NON_NULL(frame->images, false);
+
+        for (int j = 0; j < frame->images->n; j++) {
+            p2PendingImfileRow *image = frame->images->data[j];
+            fprintf (stream, "%s %s %s %s\n",
+                image->exp_id,
+                image->class,
+                image->class_id,
+                image->url
+            );
+            psMetadata *md = p2PendingImfileMetadataFromObject(image);
+            psMetadataAddMetadata(pendingmd, PS_LIST_TAIL, "pending",  PS_META_DUPLICATE_OK, NULL, md);
+        }
+    }
+
+    psString str = psMetadataConfigFormat(pendingmd);
+    psFree(pendingmd);
+    fprintf(stream, "%s\n", str);
+    psFree(str);
+
+    return true;
+} 
Index: /trunk/ippTools/src/pxtools.h
===================================================================
--- /trunk/ippTools/src/pxtools.h	(revision 6219)
+++ /trunk/ippTools/src/pxtools.h	(revision 6220)
@@ -90,5 +90,4 @@
 bool p2insertDoneFrames (pxConfig *config, psArray *doneFrames);
 bool psTimeIsZero(psTime *time);
-bool p2writePendingFrames (pxConfig *config, psArray *frames);
 psArray *p2searchDoneFrames(pxConfig *config);
 psArray *p2searchPendingImfiles(pxConfig *config);
@@ -96,2 +95,3 @@
 psArray *p2searchPendingExp(pxConfig *config);
 p2DoneExpRow *p2pendingToDoneExp(p2PendingExpRow *pendingExp);
+bool p2PendingFramePrint(FILE *stream, pxConfig *config, psArray *frames);
