diff -ru rsrce-0.1/command.c rsrce-0.1-cmd/command.c
--- rsrce-0.1/command.c	2004-03-05 17:30:32.000000000 +0000
+++ rsrce-0.1-cmd/command.c	2006-05-01 17:20:43.000000000 +0100
@@ -27,12 +27,12 @@
 #include "command.h"
 
 struct res_fork *cmd_rf;
+restype_t cmd_res_type;
+int cmd_res_id;
 struct resource *cmd_res;
 
-int cmd_selectresource(const char *spec)
+int cmd_parseresource(const char *spec)
 {
-	restype_t type;
-	int id;
 	char *colon;
 
 	if(!spec) {
@@ -45,10 +45,19 @@
 		fprintf(stderr, "Incorrect resource specification\n");
 		return 1;
 	}
-	memset(type, ' ', sizeof(type));
-	memcpy(type, spec, colon - spec);
-	id = atoi(colon + 1);
-	cmd_res = res_lookup(cmd_rf, type, id);
+	memset(cmd_res_type, ' ', sizeof(cmd_res_type));
+	memcpy(cmd_res_type, spec, colon - spec);
+	cmd_res_id = atoi(colon + 1);
+
+	return 0;
+}
+
+int cmd_selectresource(const char *spec)
+{
+	if(cmd_parseresource(spec))
+		return 1;
+
+	cmd_res = res_lookup(cmd_rf, cmd_res_type, cmd_res_id);
 	if(!cmd_res) {
 		fprintf(stderr, "No such resource.\n");
 		return 1;
@@ -108,6 +117,68 @@
 	return 0;
 }
 
+int cmd_create(char **argv)
+{
+	if(!argv[1]) {
+		fprintf(stderr, "%s <resource>\n", argv[0]);
+		return -1;
+	}
+
+	if(cmd_parseresource(argv[1]))
+		return -1;
+
+	cmd_res = res_lookup(cmd_rf, cmd_res_type, cmd_res_id);
+	if(cmd_res) {
+		fprintf(stderr, "Resource already exists.\n");
+		return -1;
+	}
+
+	cmd_res = res_new(cmd_rf, cmd_res_type, cmd_res_id);
+	return 0;
+}
+
+int cmd_delete(char **argv)
+{
+	if(!argv[1]) {
+		fprintf(stderr, "%s <resource>\n", argv[0]);
+		return -1;
+	}
+
+	if(cmd_selectresource(argv[1]))
+		return -1;
+
+	res_delete(cmd_res);
+	return 0;
+}
+
+int cmd_rename(char **argv)
+{
+	if(!argv[2]) {
+		fprintf(stderr, "%s <resource> <name>\n", argv[0]);
+		return -1;
+	}
+
+	if(cmd_selectresource(argv[1]))
+		return -1;
+
+	res_rename(cmd_res, argv[2], strlen(argv[2]));
+	return 0;
+}
+
+int cmd_chattr(char **argv)
+{
+	if(!argv[2]) {
+		fprintf(stderr, "%s <resource> <attributes>\n", argv[0]);
+		return -1;
+	}
+
+	if(cmd_selectresource(argv[1]))
+		return -1;
+
+	res_chattr(cmd_res, argv[2]);
+	return 0;
+}
+
 int cmd_ls(char **argv)
 {
 	res_ls(stdout, cmd_rf);
@@ -277,6 +348,10 @@
 } cmd_table[] = {
 	{"read", 	cmd_read,	"Read the resource fork from a file"},
 	{"write",	cmd_write,	"Write the resource fork to a file"},
+	{"create",	cmd_create,	"Create resource"},
+	{"delete",	cmd_delete,	"Delete resource"},
+	{"rename",	cmd_rename,	"Change the resource name"},
+	{"chattr",	cmd_chattr,	"Change the resource attributes"},
 	{"ls",		cmd_ls,		"List resources"},
 	{"hexdump",	cmd_hexdump,	"Show an hexdump of the resource data"},
 	{"import",	cmd_export,	"Import resource data from a file"},
diff -ru rsrce-0.1/resource.h rsrce-0.1-cmd/resource.h
--- rsrce-0.1/resource.h	2004-03-05 17:03:17.000000000 +0000
+++ rsrce-0.1-cmd/resource.h	2006-05-01 17:20:43.000000000 +0100
@@ -30,6 +30,7 @@
 void res_setdata(struct resource *r, void *p, int len);
 void res_gettype(struct resource *r, restype_t type);
 void res_settype(struct resource *r, restype_t type);
+void res_rename(struct resource *r, char *name, int nlen);
 void res_chattr(struct resource *r, const char *spec);
 void res_delete(struct resource *r);
 
