[ 
https://issues.apache.org/jira/browse/HADOOP-10877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14097514#comment-14097514
 ] 

Abraham Elmahrek commented on HADOOP-10877:
-------------------------------------------

* Nit: Maybe leave out the notion of copying since this is a utility function?
{code}
+        return hadoop_lerr_alloc(EINVAL, "subdir_check: can't copy %s into "
+                "%s, because the latter is a subdirectory of the former.",
+                src->path, dst->path);
{code}
* Nit: strncmp(src->path, dst->path, src_path_len) == 0 implies equality of 'n' 
characters. In this case, strlen(src->path) <= strlen(dst->path). If src->path 
== dst->path up to 'n' characters, then dst->path will never be smaller in size 
than src->path.
{code}
+    src_path_len = strlen(src->path);
+    if ((strncmp(src->path, dst->path, src_path_len) == 0) &&
+            ((strlen(dst->path) <= src_path_len) ||
+            (dst->path[src_path_len] == '/'))) {
{code}

+1 though... good stuff.

> native client: implement hdfsMove and hdfsCopy
> ----------------------------------------------
>
>                 Key: HADOOP-10877
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10877
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: native
>    Affects Versions: HADOOP-10388
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HADOOP-10877-pnative.001.patch
>
>
> In the pure native client, we need to implement {{hdfsMove}} and 
> {{hdfsCopy}}.  These are basically recursive copy functions (in the Java 
> code, move is copy with a delete at the end).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to