Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

CopyFile(File,File,boolean) fails, with data loss of destination file under some circumstances

Hi everybody
(16 lines)
Re: any plans for commons-logging-2.0?
(28 lines)
Feb 8, 2012
DAINOSEB
DAINOSEB
Hi to All, and thanks for the welcome!
I amfairly newto the world ofjavawhilestillbeingan expert programmerin 
dealing withthe development offile-orientedapplications such ascobol for 
over20 years. therefore excuse me for lowknowledge
I greatly appreciate Apache community work and his collaboraborative 
philosophy, and Here I am to submit my issues and proposals on regards 
to the question above. But let's go with that:


Scenarios of failure (according to thecasesthat I checkedand tested on 
Windows xp-sp3 platform:
0) Generally: Copying the same file name with different "Rooth PAth" 
(according with new java.nio Class implementation, which moreover in 
this cases doesn't come in aid)
1) Copyng for example the file c:\tmp\test.txt to x:\test.txt, having 
made a SUBST x: c:\tmp with cmd.exe
2) Same issue when the local folder c:\tmp has been shared via Windows 
share mechanism
3) Same if the Windows (or even Samba) share involve another computer in 
the LAN

The first,simplest, case demonstrates the problem and the limit in java 
libraries that, perhaphs due to my java's inexperience, have troubled me 
for weeks.
At last I've found a solution which involves a lower level of dealing 
with a mix of RandomAccessFile and the new java.nio's GetChannel methods 
of treating a file stream.

But first I wanted to hear yours opinions and feedbacks if you ever have 
meet such problems and how have you solved tha question.

Good coding to all!



Reply
Loss of Binary Data in Dump File
October 27, 2010 01:48:45 PM
Hi All, New to this list and hoping someone can help. I have a sqlite3 database that contains a couple of tables that have binary data in BLOB columns. I know the data is in there and stored correctly because the application accessing the database…
Created] (IO-282) Add API FileUtils.copyFile(File input, OutputStream output)
August 30, 2011 12:16:03 PM
Add API FileUtils.copyFile(File input, OutputStream output)
Commented] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
May 11, 2011 05:50:03 PM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= 13032146#comment-13032146 ] Dag H. Wanvik commented on DERBY-2254:
Updated] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
April 1, 2011 02:19:45 PM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas updated DERBY-2254:
Commented] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
May 12, 2011 01:50:49 PM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= 13032577#comment-13032577 ] Rick Hillegas commented on DERBY-2254:
Commented] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
May 12, 2011 02:00:29 PM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= 13032583#comment-13032583 ] Rick Hillegas commented on DERBY-2254:
Resolved] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
May 12, 2011 02:00:32 PM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas resolved DERBY-2254.
Assigned] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
May 11, 2011 08:20:29 AM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas reassigned DERBY-2254:
Updated] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
May 10, 2011 02:38:29 PM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas updated DERBY-2254:
Updated] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
May 11, 2011 08:24:33 AM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas updated DERBY-2254:
Commented] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
May 11, 2011 05:06:34 PM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= 13032109#comment-13032109 ] Knut Anders Hatlen commented on DERBY-2254:
Updated] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
May 11, 2011 02:33:34 PM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas updated DERBY-2254:
Commented] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
May 11, 2011 12:34:49 PM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= 13031875#comment-13031875 ] Dag H. Wanvik commented on DERBY-2254:
Updated] (DERBY-2254) Assert during log file switch: log file position exceeded max log file size
May 11, 2011 08:24:51 AM
[ https://issues.apache.org/jira/browse/DERBY-2254?page=com.atlassian.ji ra.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas updated DERBY-2254:
Resolved: (CAMEL-3369) Add option to create done file for file/ftp producer when file has been writt
December 17, 2010 03:36:30 AM
[ https://issues.apache.org/jira/browse/CAMEL-3369?page=com.atlassian.ji ra.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen resolved CAMEL-3369.
Commented: (CAMEL-3369) Add option to create done file for file/ftp producer when file has been writ
December 17, 2010 03:06:28 AM
[ https://issues.apache.org/jira/browse/CAMEL-3369?page=com.atlassian.ji ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= 12972400#action_12972400 ] Claus Ibsen commented on CAMEL-3369:
Assigned: (CAMEL-3369) Add option to create done file for file/ftp producer when file has been writt
December 17, 2010 01:18:53 AM
[ https://issues.apache.org/jira/browse/CAMEL-3369?page=com.atlassian.ji ra.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen reassigned CAMEL-3369:
Created: (CAMEL-3097) Add file:size to file language to be an alias for file:length
September 1, 2010 08:17:12 AM
Add file:size to file language to be an alias for file:length
Created: (CAMEL-3369) Add option to create done file for file/ftp producer when file has been writte
November 26, 2010 06:55:51 AM
Add option to create done file for file/ftp producer when file has been written
Created] (HIVE-2683) load data twice from the same hdfs file without overwrite fails with return cod
December 27, 2011 04:01:14 PM
load data twice from the same hdfs file without overwrite fails with return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
Apache/PHP experts? Large file download fails: empty file is saved with zero KB
November 25, 2009
I have a web page that I use to give authenticated users access to download files. The files are in the root folder (not normally HTTP accessible),…
FTPWebRequest: Transfer from one FTP to another FTP, Destination file corrupt
March 17, 2011
Here's my agonizing problem. I'm transferring from one FTP (a Dev site) to another FTP (a Test site). Spare me the thoughts of changing this…
Htaccess: Redirect file.php to file.html, and block direct access to the file.php at the same time.
June 23, 2011
I would like to redirect a url help.html to help.php (internally) using .htaccess rewrite, but at the same time, I would like to give a 404 error…
Hadoop jar needs to read model file, and I got java.io.FileNotFoundException: data/ner/pattern.trd (No such file or directory)
March 14, 2011
Hi, I'm new to hadoop. My dfs details is as follows, $ hadoop fs -ls Found 5 items drwxr-xr-x - hadoop supergroup 0 2011-03-14 19:44…
File download fails over https in IE
March 4, 2011
I'm trying to download a file over HTTPS & it fails in IE but works perfectly with Firefox & Chrome: aspx code is as follows: <%@ Page…
Php fopen fails to open a file for writing in Mac OS X
May 1, 2011
I'm running php script updreading.php locally on my laptop (with Mac OS X 10.6.7). Here's the contents of updreading.php <?php $outFile =…
Wordpress fails to generate .htaccess file
February 20, 2011
Wordpress does not have the permission to generate .htaccess or config files. I just setup a LAMP server with the apt-get install lamp-server^…
PHP fopen fails - does not have permission to open file in write mode.
January 30, 2011
Hello. I have an Apache 2.17 server running on a Fedora 13. I want to be able to create a file in a directory. I cannot do that. Whenever I try to…
Better query strategy to sort files by file hash frequency and file size
March 5, 2011
I've wrote this query without much thought but as a beginner I'm almost sure it could be written better. Here it's: SELECT files.filehash, filename,…
Use htaccess to change file type, works on some servers, others it prompts download of file.
January 12, 2011
Hello, I'm using htaccess to change a file extension from gif to php but it does not change on a particular test server, instead it prompts a…
Virtual host conf file redirect adds local file path
May 25, 2011
I'm adding the following rewrite to the conf file for my virtual host: RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com RewriteRule (.*)…
MySQL: mysqlimport to import comma delimited file - first column = ID which is NOT in the file to be imported
March 22, 2011
Hi Folks I am trying to import a very large file that has moisture data recorded daily per minute for 20 cities in the US. I have 1 table that I…
How to restrict/forbid access to specific file types such as .js .css inside a .htaccess file?
April 9, 2011
If the remote user knows the exact location of the file, he will still be able to access the file from a browser. How can someone find out about the…
Php file outputting javascript for include as a JS file - need to restrict so its not opened in a browser window
January 4, 2011
Hi guys, I'm storing configuration details in a database which I need to use in javascript. I'm accessing all this using php and instead of…
List file names based on a filename pattern and file content - GREP ??
May 6, 2011
How can i use Grep command to search file name based on a wild card "LMN2011*" listing all files with this as beginning. I want to add another check…
Can a web-based file upload control ftp the file to a separate server without uploading to the webserver?
March 13, 2011
I would like to create a web page that can be used to upload files to an ftp server. I watched this video on how to do it -…
Apache server ubuntu 10.10 returns a PHTML file to download instead of php file
March 2, 2011
Hi. I seting up LAMP on my ubuntu box. I have only changed the sites-available-default/default <VirtualHost *:80> ServerAdmin…
How to Read the certificates file from the PKCS7.p7b certificate file usind openssl ?
June 16, 2011
hi i am getting PKCS7 file p7b .i want to read the content of the file and extract certificate in X509 structure. how can i access individual…
Rewrite rule for .htaccess not working for php file but workid for html file
February 2, 2011
Why RewriteEngine On RewriteRule .* index.php was not working (i am getting internal server error) but for RewriteEngine On RewriteRule .*…