lkml.org 
[lkml]   [2003]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: OT: why no file copy() libc/syscall ??
Florian Weimer wrote:
> Andreas Dilger wrote:
>
>
>>>This is fast turning into a creeping horror of aggregation. I defy anybody
>>>to create an API to cover all the options mentioned so far and *not* have it
>>>look like the process_clone horror we so roundly derided a few weeks ago.
>>
>> int sys_copy(int fd_src, int fd_dst)
>
>
> Doesn't work. You have to set the security attributes while you open
> fd_dst.

int new_fd = sys_copy( int src_fd ); /* cloned copy, out of any fs */
fchmod( new_fd, XXX_WHAT_EVER ); /* do the job. */
...
flink(new_fd, "/some/path/some/file/name"); /* commit to fs */
close(new_fd); /* bye-bye */

I beleive this can be more useful. Not only in naive tries to replace
cp(1) with kernel ;-)

--
Ihar 'Philips' Filipau / with best regards from Saarbruecken.
-- _ _ _
"... and for $64000 question, could you get yourself |_|*|_|
vaguely familiar with the notion of on-topic posting?" |_|_|*|
-- Al Viro @ LKML |*|*|*|

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.079 / U:1.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site