apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44127] - File Extended Attributes Support
Date Mon, 07 Jan 2008 02:24:58 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From michael@metaparadigm.com  2008-01-06 18:24 -------
(In reply to comment #10)
> typedef struct apr_file_xattr_t;
> 
> apr_file_xattr_open(apr_file_xattr_t **xattr, const char *pathname, ....)
> apr_file_xattr_fdopen(apr_file_xattr_t **xattr, apr_file_t *file, ....)
> apr_file_xattr_destroy(apr_file_xattr_t *xattr);

OK. I like this approach. I was also wondering about dropping the _file
prefix due to them also working on directories (apr_stat as an example):

apr_xattr_path_open(apr_file_xattr_t **xattr, const char *pathname, ....)
apr_xattr_file_open(apr_file_xattr_t **xattr, apr_file_t *file, ....)
apr_xattr_dir_open(apr_file_xattr_t **xattr, apr_dir_t *dir, ....)
apr_xattr_get(apr_file_xattr_t *xattr, const char *name, ...)
...
apr_xattr_destroy(apr_file_xattr_t *xattr)

with a cleanup similar to file_open (call to apr_xattr_destroy explicitly runs
cleanup otherwise it is run at pool cleanup time - path_open variant cleanup
would close the fd but not the file_open or dir_open variants).

> I think you don't need to pass flags/pool to each function, by using the
> above interface you can keep the flags inside the apr_file_xattr_t struct.

The APR_XATTR_NOFOLLOW could be used on the pathname _open variants but the
flags are needed on xattr_set for APR_XATTR_CREATE or APR_XATTR_REPLACE. This
needs to be operation specific (not chosen at open time).

It may be a good idea to keep flags on all ops as in the future we could add
APR_NAMESPACE_SYSTEM for example which would be relevant for all functions e.g.
set|get|list|remove and should be operation specific (not chosen at open time).

> The way the files are built should be done the other way around, look at
> how the atomic files are built. Since you already have the USE_XATTR_*
> macros you just need to cover each file if a #if on the macro. This way
> all the files are built and dependencies are automatically tracked.

OK. I'll look into this. Thanks for the feedback. I'll roll another patch in a
few days time based on this approach.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message