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

Sanjay Radia commented on HADOOP-4494:
--------------------------------------

Minor doc suggestion:

In the documentation in hdfs.h
+     * @param flags Either O_RDONLY or O_WRONLY[|O_APPEND] for read-only or 
write-only.

O_WRONLY is for create not for writing to arbitrary part of a file.
Update the comment to indicate that O_WRONLY is for creating, etc.


I just noticed that the test uses O_CREAT but the impl does not even bother 
checking for this (ie treats O_WRONLY as create):
+++ src/c++/libhdfs/hdfs_test.c (working copy)
+      // CREATE
+      hdfsFile writeFile = hdfsOpenFile(fs, writePath, O_WRONLY|O_CREAT, 0, 0, 
0);

Unfortunately fixing this to match posix will break compatibility of apps, 
since truck libhdfs did not check for O_CREAT either.

> libhdfs does not call FileSystem.append when O_APPEND passed to hdfsOpenFile
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-4494
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4494
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 0.19.1, 0.20.0
>            Reporter: Pete Wyckoff
>            Assignee: Pete Wyckoff
>             Fix For: 0.19.1, 0.20.0
>
>         Attachments: HADOOP-4494.txt
>
>
> libhdfs currently calls FileSystem.create when O_APPEND passed in - ie it 
> ignores this flag

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to