Skip to content

Getting data object and collection renaming to work#3

Closed
nickeddy wants to merge 2 commits intoiPlantCollaborativeOpenSource:masterfrom
nickeddy:master
Closed

Getting data object and collection renaming to work#3
nickeddy wants to merge 2 commits intoiPlantCollaborativeOpenSource:masterfrom
nickeddy:master

Conversation

@nickeddy
Copy link
Copy Markdown

@nickeddy nickeddy commented Jan 7, 2014

Tried to set up a connection and do a data_object.rename('new_filename'), but ran in to this:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "irods/data_object.py", line 42, in rename
    self.manager.rename(self.path, new_name)
  File "irods/resource_manager/data_object_manager.py", line 107, in rename
    response = conn.recv()
  File "irods/connection.py", line 35, in recv
    raise get_exception_by_code(msg.int_info)
irods.exception.SYS_PACK_INSTRUCT_FORMAT_ERR

Most likely how I'm implementing things in irods.message, though here's the structs for the irods rename protocol:

#define RHostAddr_PI "str hostAddr[LONG_NAME_LEN]; str rodsZone[NAME_LEN]; int port; int dummyInt;"
#define fileRenameInp_PI "int fileType; struct RHostAddr_PI; str oldFileName[MAX_NAME_LEN]; str newFileName[MAX_NAME_LEN];"

Hopefully I've gotten this started on the right track to get renaming working.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a way to get connection information... wasn't entirely sure how to grab the irods.connection.Connection from the DataObjectManager.

@cjlarose
Copy link
Copy Markdown
Contributor

cjlarose commented Jan 8, 2014

@nickeddy, thanks for working on this! I've tried before to get copying/renaming working and I gave it a rest because of similar complications.

I took your code and made a new branch called rename. I swapped out the fileRenameInp_PI and RHostAddr_PI structs in favor of the DataObjCopyInp_PI struct instead. This is consistent with both the PHP client (PRODS) and the C client (icommands).

Unfortunately, this implementation is equally wrong. I still get a SYS_PACK_INSTRUCT_FORMAT_ERR Exception returned. I'll look into this later this week, but I thought maybe seeing the changes on that branch might help in the meantime.

jmatt pushed a commit that referenced this pull request Sep 17, 2014
jmatt pushed a commit that referenced this pull request Sep 17, 2014
jmatt pushed a commit that referenced this pull request Sep 17, 2014
jmatt pushed a commit that referenced this pull request Sep 17, 2014
jmatt pushed a commit that referenced this pull request Sep 17, 2014
jmatt pushed a commit that referenced this pull request Sep 17, 2014
jmatt pushed a commit that referenced this pull request Sep 17, 2014
jmatt pushed a commit that referenced this pull request Sep 17, 2014
jmatt pushed a commit that referenced this pull request Sep 17, 2014
@jmatt jmatt closed this Sep 17, 2014
@cjlarose
Copy link
Copy Markdown
Contributor

This is awesome! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants