Prevent deletion of file when it is being copied

Nimit Shah nimit.svnit at
Thu Sep 27 06:27:21 UTC 2012

Thank you Emmet and Nicholas!

@Nicholas: Yes I had tried it in Nautilus only and I had deleted the source

Nimit Shah,
B Tech 4th year,
Computer Engineering Department,

On Thu, Sep 27, 2012 at 11:10 AM, Nicolas Michel <
be.nicolas.michel at> wrote:

> I think the problem that Nimit explains is only related to Nautillus. Am I
> right Nimit? Also you didn't said if the file you deleted was the source or
> the destination one?
> Regards,
> Nicolas
> 2012/9/27 Emmet Hikory <persia at>
>> Nimit Shah wrote:
>> > While copying a file from my computer to external disk, I by mistake
>> > shift+deleted the file. But still the file transfer dialog showed that
>> it
>> > was continuing. At the end of the transfer it failed.
>> >
>> > Hence i request you to add a check for file transfer before deleting the
>> > file.
>>     As much as this would be a lovely feature, I don't believe that it is
>> something that we could implement in Ubuntu.
>>     When copying a file, there are usually two ways to go about it: either
>> open the entire file, and write it to a new location, or open a series of
>> sections of the file, and write them each to a new location.  There are a
>> very large number of programs that provide both of these mechanisms in the
>> archive.  In the majority of cases, the first potential solution is not
>> used, because it limits file copies to files that fit entirely in memory
>> (with everything else), and requires a longer-running algorithm, but
>> when the second method is used, the file cannot be allowed to be deleted
>> before the file transfer is confirmed as complete.
>>     When deleting a file, the usual practice is to remove the reference
>> from the directory definitions (unlinking), leaving the underlying
>> filesystem
>> to manage recovery of the newly available space.  Again, there are a vast
>> number of packages in the archive providing programs that do this.
>>     In order to implement the feature you describe, we would have to
>> either
>> provide some systems interface that traps all calls to unlink() and checks
>> some external reference to determine if it is being copied or patch all
>> software that could potentially delete files to check the reference,
>> whilst
>> simultaneously patching every package that provides a means to copy a file
>> to populate this reference during the file copy, which would make all such
>> operations considerably slower, with potentially massive impact on server
>> capacities, interactive response times, and battery life.
>>     Further, it is unlikely that the developers and maintainers of most of
>> the software in our archive would be willing to accept such patches, given
>> the potential complications and incompatibilities with other systems, such
>> that the result of this vast undertaking would require considerable
>> ongoing
>> development effort to port these patches for each new upstream release.
>>     Lastly, in the event that any of the programs providing file copy
>> functionality were to crash, they may not properly clear the reference
>> indicating files whose deletion need block on the transfer completion.
>> As a result of such a crash (or any other bug when updating references),
>> a user's system may end up having any number of files that cannot be
>> deleted without manual intervention into the file transfer reference.
>> --
>> Emmet HIKORY
>> --
>> Ubuntu-devel-discuss mailing list
>> Ubuntu-devel-discuss at
>> Modify settings or unsubscribe at:
> --
> Nicolas MICHEL
> --
> Ubuntu-devel-discuss mailing list
> Ubuntu-devel-discuss at
> Modify settings or unsubscribe at:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Ubuntu-devel-discuss mailing list