Results 1 to 6 of 6

Thread: Delete one end of the file

  1. #1
    Join Date
    Dec 2009
    Posts
    192

    Delete one end of the file

    Hello,
    I'm trying to do something that seems impossible from API features. I have a file that contains a set of block. At one point, I am prompted to delete a block of the file, ie my file to the end must be there before, and what there after. Having traveled a good part of the API for I / O, the only way I found it to truncate my file at the beginning of the block and then rewrite everything that was after, which potentially represents a chunk. transferTo () and Transfer from () to FileChannel air to say that optimizes a little depending on the behavior of the OS that the latter changes its indexing of pages instead of copying bit by bit. So here's my question- simple way to turn a piece of a specific file without having to have a stream opened on the end and rewrite everything in the end just to concatenate? A function that adds a piece to another discard all that is in the middle after all?

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Delete one end of the file

    Hello,
    I already doubt the existence of such function in the bone, then for what is to map a hypothetical method in java. You're not the choice is rewriting. If really it poses problems (like the file is 15G, takes 30 seconds for each operation), tries to combine your breaks. and then tries to change your file format to accept holes (see moves a block from the end towards the hole).

  3. #3
    Join Date
    Dec 2009
    Posts
    192

    Re: Delete one end of the file

    Hi,
    Yes, except not, because the blocks are more scalable. In short, everything that I see as the solution is to rewrite, or add a system with holes and a system defrag afterward. The files will probably not 15GB as you say, but in any case, it is highly probable that I should "cut" a piece of very many times in a time very short. So, even if the file is not necessarily very large, if I do this all the time, I lost hugely in perf over a system where I could link directly to the end after following the end of 'before.

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Delete one end of the file

    Hello,
    From a system standpoint, it is actually not possible to delete a block in the middle of file. We must rewrite, I think you have no choice for this. It is how big the average file is? I do not think that there is any other alternative for this. Just try doing this, if you have any problem then post back. And remember to post the error or the warning message you get.

  5. #5
    Join Date
    Dec 2009
    Posts
    192

    Re: Delete one end of the file

    Hello,
    It is configurable but we will say that overall it will make some Mo, probably between 20 and 50 Mb max. Anyway, this is potentially read and overwrite any file if you delete a block that was at first. I fear that this is not negligible when it will have to do this with a vengeance. The rise in memory, I'd rather not if I win and then I lost in memory for the rest of the application which is already large fairly heavy memory.

  6. #6
    Join Date
    May 2008
    Posts
    2,297

    Re: Delete one end of the file

    Hello,
    What is the application we do not care. But it needs to store data files needed for its operation. Every time it changes a little or given, this must be reflected in the backup file. I must update somehow the file to remain synchronized with the data. Outside, if the data is now smaller, I wanted to clear the hole. Similarly if we remove a given.

Similar Threads

  1. Replies: 3
    Last Post: 21-03-2012, 09:10 AM
  2. cannot delete file -- cannot read from source file or disk
    By Amitgujaran in forum Windows XP Support
    Replies: 3
    Last Post: 11-11-2010, 09:55 PM
  3. Can't delete 0 byte file, with no file type
    By Adele2 in forum Windows XP Support
    Replies: 8
    Last Post: 15-12-2009, 12:33 PM
  4. Cannot delete file with no name disk file
    By Shanbaag in forum Windows Software
    Replies: 4
    Last Post: 17-08-2009, 02:14 AM
  5. XP: Cannot delete file: Cannot read from the source file or disk.
    By iexplorer0726 in forum Operating Systems
    Replies: 0
    Last Post: 10-09-2007, 05:07 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,115,392.87711 seconds with 17 queries