Skip to main content

All File Deletion is a Disputed Transaction in Windows Explorer but an Iterative Delete in Dos Prompt

All File Deletion is a Disputed Transaction in Windows Explorer but an Iterative Delete in Dos Prompt

I normally have the habit of cleaning up the temp folder in my Windows on a regular basis so that it does not unnecessarily eat away the hard disk space. However, I observed two distinct behavior between Windows Explorer and MSDOS prompt of the temp folder.

Windows Explorer:

  1. To avail the friendly GUI services, we normally resort to CTRL+A and DELETE.
  2. Attempts to delete the folder and files one by one. But even when one file could not be removed due to permission restriction or 'The process can not access the file because it is being used by another process' error, it just aborts without visiting remaining files in the folder.
  3. Moves the folder to Recycle Bin
  4. A generic progress bar of the progress of deletion is indicated by a GUI popup.
  5. Recurses into folders and repeates (2) through (4).

MSDOS:

  1. Command Used: del . and press y when prompted.
  2. Attempts to delete the folder and files one by one. But when a particular file could not be deleted, it emits an appropriate error message along with the erring file but resumes with the next file.
  3. Does not move the file to Recycle Bin but permanently purges it.
  4. At least the command used in (1) does not recurse through the folders.

Windows, at least a quick layman's view seems to be nurturing an incomplete transaction implementation. If one debates that the file deletion should be aborted like in a transaction, then the files/folders that were deleted should also be rolled back and restored to the current state right?

Comments

Popular posts from this blog

Google NCR

Google NCRMost of you would be knowing about this trick in navigating to Google generic website. But I just came to know only a few days before and hence thought I would share the information with others too.
Whenever you type http://www.google.com/, Google automatically tries to redirect you to your country-specific website. For me, it always redirects to http://www.google.co.in/ (Google India). But when we specifically want to navigate to Google Generic website for some reason, there are two ways to accomplish the same.Click the 'Go to Google.com' link at the bottom of the webpage that is displayed from http://www.google.co.in/To prevent this redundant click, you can opt to type http://www.google.com/ncr/ which would prevent the redirect from happening. The NCR stands for No Country Redirect. There is a brief discussion about this NCR over this forum.You may also like to check out Google help documentation regarding the country redirections from here.

Elegant 'MailTo' Replacement

Elegant 'MailTo' Replacement

MailTo tags have become a bane to all websites since spammers run spam robots which crawl the web to capture the email addresses, add to their catalogs and send spams to them. I just thought of sharing with others a simple JavaScript function which would trigger open the default email client instead of having mailto: embedded in the HTML Page.

Just have the following function included in your webpage

<script language='Javascript'>
function WriteMailTo(user,domain)
{
location.replace ('mailto:'+user+'@'+domain);
}
</script>

And whereever you want to invoke the mailto, just called WriteMailTo('user','example.com') and the user's default email client should be launching (if configured) without any hassles.

Contacts import utility from Web2Project to Addressbook

I have been using Web2Project for planning my personal and professional tasks for a few years now. Now I have bifurcated the tools into the following:

Project PierAddress Book The only issue I had was to import my addressbook from Web2Project to AB. PP is a different animal. It does not serve as a comprehensive candidate for addressbook and hence I needed this bifurcation. 
I wrote up a following simple script to import the contacts to AB. The pre-requisite for this script is to hop on to PhpMyAdmin, export the contacts as a PHP array and then  modify the path in our import script to whatever you downloaded from PhpMyAdmin.
Our import script would explode the entries as SQL scripts into the browser window. Copy them and execute into PhpMyAdmin AB database to have the contacts imported.

Script URL: https://gist.github.com/lavanyadeepak/5177500#file-import-php