Thursday, February 21, 2008

Removing double spaces in dreamweaver

I've been having a problem with Macromedia Dreamweaver CS3 adding double spaces (an extra line) to files I download to edit. I made sure my FTP program (FireFTP) and Dreamweaver are sending the files binary instead of Ascii, but that didn't help. I could not use Commands>>Apply Source Formatting - because it is a php file.

As it turns out that end of the line characters can be formatted differently for different systems; i.e. Unix (Line Feed), Windows (Control Break & Line Feed), Mac (Control Break). My Dreamweaver setup was formatting the files with a Windows line end character while the files were from Unix thus adding the extra line.

So to remove the double spaces I set: Dreamweaver>>Edit>>Preferences>>Code Format>>Line Break Type to "LF (Unix)" ... problem solved!

P.S. I also learned during that in Dreamweaver you can use Shift>Enter to create a single line (
) instead of Enter which creates a double line (

).

Saturday, February 16, 2008

Vista: Access denied error while trying to delete files

Sometimes in Microsoft Vista, simple tasks such as deleting files is not an easy thing! After my gateway system crashed I created a backup and restored with the Gateway Recovery Center. It worked great. All the files of of system, including the Windows directory, were backed up under C:\Backup. After picking through my old user files and moving them to the new install I was then ready to delete all the useless C:\Backup files as they were taking up about 20gb of space! However, whenever I tried to delete the files I got a "Access Denied" error. After hours of trial and research here is what worked for me.

I took ownership of the files . Using the link is easiest and shows you how to create a registry key and take ownership of the files through a simple shift + right click menu. Deleting the files was possible after I ran this however I did have to run it twice on stubborn files that did not want to delete. Also, run the command on a single folder instead of multiple-selecting folders because you will have to click Vista's lovely "continue" prompts for each folder.

If you don't want to install something permanently in your registry you could also use the command like to do this. You have to use the takeown and icacls commands. Make sure you start the command window with "Run as Administrator" or you will run into problems.

Here are the commands to use:
  • takeown /f "C:\yourdirectory\" /r
  • icacls "C:\yourdirectory" /grant administrators:F
If you get error messages and need to chose Skip then retry the commands on the subfolders until all the files are deleted.

In certain cases on you may get a "Destination Folder Access Denied". You can get around this by holding Shift while you drag the folder to the Recycle Bin. This will delete the files directly without moving them to the Recycle Bin.