commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Holger Hoffstätte (JIRA) <j...@apache.org>
Subject [jira] Commented: (IO-77) [io] add a convenience FileUtils.move(File src, File dest)
Date Wed, 04 Apr 2007 17:43:33 GMT

    [ https://issues.apache.org/jira/browse/IO-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12486716
] 

Holger Hoffstätte commented on IO-77:
-------------------------------------

NIO can potentially be optimized by the OS to be zero-copy, i.e. without constantly copying
buffers to userland. Whether that actually happens is an implementation detail. :)
However it should be obvious that shoveling large files through small buffers by using the
CPU is .. not optimal.


> [io] add a convenience FileUtils.move(File src, File dest)
> ----------------------------------------------------------
>
>                 Key: IO-77
>                 URL: https://issues.apache.org/jira/browse/IO-77
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 1.0
>         Environment: Operating System: other
> Platform: Other
>            Reporter: nicolas de loof
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: patch_io.txt
>
>
> I'm using FileUtils as it partially solves the missing "move" method for File,
> that is so simple to do in unix shell.
> A full implementation in FileUtils may be great :
> static boolean FileUtils.move(File src, File dest)
> throws IOException
> {
>     boolean rename = src.renameTo(dest);
>     if (!rename)
>     {
>         copyFile(file, dest);
>         file.delete();
>     }
> }

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message