Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Fix a possible 'disappearing file on Desktop' bug Desktop
I was copying some files to my friend's Desktop folder, and noticed that one of the files disappeared. I used Terminal's ls command and saw that the file was still there, but not visible in the Finder. After playing around a bit more, I found that files were disappearing and appearing quite consistently.

After trying to set the files' visibility with the SetFile command (included with Developer Tools), I thought maybe the folder was corrupt. So I backed up all the data in his Desktop folder, and then did a rm -rf ~/Desktop to remove the Desktop folder and its contents completely.

I then relaunched the Finder to allow the OS to recreate the Desktop folder. On relaunch, the problem was gone -- and he'd been dealing with this for a year. I couldn't find anything on this in the archives or on Google; hope this helps someone.

[robg adds: Please heed the backup warning -- rm -rf is forever, as they say. I haven't heard of Desktop folder corruption issues, nor did I realize the OS would automatically recreate it if it were missing...]
    •    
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[23,825 views]  

Fix a possible 'disappearing file on Desktop' bug | 18 comments | Create New Account
Click here to return to the 'Fix a possible 'disappearing file on Desktop' bug' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Sounds a bit drastic
Authored by: gidds on Mar 18, '05 11:00:14AM
I've seen files disappearing in the Finder, too, but only very occasionally, and from inside a folder which was itself on my Desktop, not from the Desktop directly.

For me, the problem seemed to occur when the folder was currently open in the Finder, and a background app wrote or moved files there; the Finder wouldn't spot the extra file, not even after closing and reopening the folder.

I don't remember exactly how I fixed it, but it wasn't anything as drastic as deleting the folder!  I think I tried removing the .DS_Store file, and then quitting and restarting the Finder.  (You'll need to have enabled the Finder's Quit option, with something like TinkerTool.)  Basically, you have to persuade the Finder to rescan the folder somehow.

Of course, certain files are hidden from the Finder deliberately: those starting with a dot, those with the Invisible HFS attribute, those listed in a .hidden file in that folder, and probably where permissions on the folder don't allow listing files &c.  So you won't get it to display those whatever you do!

---
Andy/

[ Reply to This | # ]

Sounds a bit drastic
Authored by: jporten on Mar 18, '05 11:18:02AM

You can quit the Finder by option-control clicking on the Finder icon in the Dock and choosing "Relaunch."



[ Reply to This | # ]
Sounds a bit drastic
Authored by: BTFrank on Mar 18, '05 03:08:46PM

I'm the poster. I created an account because I just wanted to say that in my case I had also tried deleting the .ds_store. Of course, I had hoped that would work. Unfortunately in my case I had to delete his whole folder.



[ Reply to This | # ]
Sounds a bit drastic
Authored by: The_Clicker on Mar 21, '05 07:35:01AM
I'll have to go along with Gidds. Often, when I'm having the Finder behaving in a funky manner, I find that deleting the invisible .DS_Store file and relaunching the Finder solves the problem.

From a GroupLogic page:

"...comments are kept in a directory meta-information file called .DS_Store. When OS X moves or copies files around, the .DS_Store files in the appropriate folders are modified so that the comments move along with the file, even though they aren't stored in the meta-information of the file itself. ...Finally, the .DS_Store file was not designed for multi-user use. If multiple users modify the file simultaneously data loss can occur. Although this happens with comments it is more often seen with the default view and the positioning of icons for a folder [emphasis mine]. The problem is that the last person who writes to the .DS_Store will have their changes overwrite some or all of the changes other people have made. This is even further complicated by the fact that the .DS_Store files are written lazily. - that is, until the volume is unmounted the Finder will not try to put add its changes to the .DS_Store."

[ Reply to This | # ]
Macintosh HD icon 'free space' info is wrong.
Authored by: Anonymous on Mar 18, '05 03:14:10PM

Perhaps related, my Macintosh HD desktop icon's free space info is rarely accurate. (I have "Show item info" checked, so that I can see total space and free space.) Finder says one thing, the icon says another. Sometimes it's been off by 10GB! I don't think it's related to Trash, because I usually leave it empty.



[ Reply to This | # ]
Macintosh HD icon 'free space' info is wrong.
Authored by: lunarthar on Mar 18, '05 05:05:22PM

This is because the info in the icon is updated only the next time Finder is restarted. If you do a "get info" on the hard disk though, then the free space shown is correct. So you need to quit Finder and when it restarts then the free space info will be correct - Just press Command-option-escape and relaunch finder, the info will be correct. As an alternative type df -h in the terminal - this always shows the correct disk space info for all mounted disks



[ Reply to This | # ]
Macintosh HD icon 'free space' info is wrong.
Authored by: BMarsh on Mar 20, '05 07:47:42PM

copying any file into the base directory will cause the size or free space to be re-calculated

I've noticed this in 2 cases,
1) On the Desktop when you have Show Item Info (in View options)
the "xxx MB free" does not update until something at the base level of that hard drive changes (copy or move a text clipping or something small to that drive, and it should update very quickly)

2) In List view when Calculate All Sizes is turned on, a folders size does not update if a sub folder is actually getting changes, you have to make a change to the number of files (one in, or one out) in the folder you want to see the size of.

These cases do not affect the Get Info window, only what is displayed directly in finder windows. I Hope this is somewhat clear, I'm a little tired.



[ Reply to This | # ]
Fix a possible 'disappearing file on Desktop' bug
Authored by: mjcohen on Mar 18, '05 06:18:57PM

I have a similar, sporadic problem with the finder (older g4 ibook, 10.3.8, < 2gb free out of 40gb). Sometimes, the finder does not show any files. ls and emacs show that the files are really there. The only cure is to log out and log back in.

Weird.



[ Reply to This | # ]
Fix a possible 'disappearing file on Desktop' bug
Authored by: luhmann on Mar 18, '05 08:43:51PM

On my last iBook I noticed this frequently when taking screenshots, which are automatically saved to the desktop. They would often disappear as soon as they were created...



[ Reply to This | # ]
Fix a possible 'disappearing file on Desktop' bug
Authored by: jweinberger on Mar 18, '05 09:02:11PM
I have had this also in odd situations - fortunately only a few times.

When I look at ls -l in terminal it turns out the "invisible" file also has a size of 0. I just rm the file (or sudo rm if needed) and recopy it.

I'ts a pain if you're trying to do something automated, but if you just need the file, recopying seems far less harsh than a Finder Relaunch (BTW: you can relaunch the Finder from the "Force Quit" dialog also cmd-option-esc)

[ Reply to This | # ]
Fix a possible 'disappearing file on Desktop' bug
Authored by: jzdziarski on Mar 19, '05 08:12:26AM

You might consider just moving it somewhere... mv Desktop Desktop.old should do the trick. That way you don't run the risk of deleting anything you shouldnt.



[ Reply to This | # ]
Fix a possible 'disappearing file on Desktop' bug
Authored by: cagg on Mar 19, '05 03:25:28PM

I had a similar thing happen to me during this past week, although I think the trouble went a little further than this. I had a list of mp3 files in my Music folder and every time I clicked on one, the file would disappear. Even in Terminal the files were not there! I was wondering what the hell was going on. And it wasn't all files in that folder, just files from a few weeks ago. I decided to reboot and pray. That fixed it - they were back. (It's also possible that having journalling enabled on my drive helped.)



[ Reply to This | # ]
Fix a possible 'disappearing file on Desktop' bug
Authored by: ahancock on Mar 19, '05 04:09:06PM

I would bet this is just a display issue.

I would use an app like Finder'Fresher before deleting anything.

-ahancock



[ Reply to This | # ]
Fix a possible 'disappearing file on Desktop' bug
Authored by: ahancock on Mar 19, '05 04:10:04PM

I would bet this is just a display issue.

I would use an app like Finder'Fresher before deleting anything.

-ahancock



[ Reply to This | # ]
Fix a possible 'disappearing file on Desktop' bug
Authored by: mschaff on Mar 21, '05 09:43:11AM

It *is* a display issue and but also appears to be two bugs. They are as follows:

1. If a file is downloaded or copied to the desktop or a folder in the Finder or a Unix command is run that does the same, sometimes the Finder window will not "refresh" immediately. The workaround is matter of forcing a refresh. Logging out/in is drastic, but will work, but also will other things mentioned above. I still (10.3.8) frequently have this problem and I think it's been around for a long time (i.e. since the beginning of OS X, 10.0). Possibly to make the system more responsive, the Finder does not actively "poll" for file changes in directories.

2. The other bug I've seen on another user's machine. A girl I work with had a disc of photos. As she clicked on the photo file in the Finder, the icon disappeared. Being a computer novice, she thought the files were being erased, but obviously on a CD, the files were fine. A restart corrected the problem, but until that point, I had never seen that one before. I believe this was under 10.3.7.



[ Reply to This | # ]
Fix a possible 'disappearing file on Desktop' bug
Authored by: sosventures on Jan 20, '06 01:44:36PM

Yeah, the same bizarre thing happened to me, although a bit differently... I started getting Error -36 whenever I tried to create a file or folder on the desktop, I was unable to do anything to the desktop.

The problem first materialized by half of the files on my desktop disappearing. Then a week went by before it got unbearable, and finally when I started fiddling it got really bizarre, I'd tried to drag a single file to the desktop and all the desktop files would disappear.

I'd never seen anything like it before on a Mac.

Then, it was like a ghost was in the machine, because while I couldn't see the files in the finder or using the terminal (ls -a), the files weren't completely gone, because after I'd delete the Desktop DF and Desktop DB files they would reappear, but as soon as I tried to create a file on the desktop everything would disappear, both from the Finder and the Terminal. Anyway the desktop files reappeared long enough for me to copy them out after I deleted the Desktop DF files.

Wasn't able to remove the Desktop directory as you suggested because even though there was nothing in it, could not remove it because it said it wasn't empty.

I was able to rename it however, and when I restarted, I was able to move files and create folders on my desktop once again.

I suspect there are still problems with my file system, however, so I'm using CCC (carbon copy cloner) to back up the files, and I'm going to reformat my hard drive. :-(

One reason for thinking that the file system isn't working right is because I tried to unencrypt the FileVault after that and it wouldn't let me. And on top of that, the trash couldn't be emptied of it's contents, etc. etc.

Well, whatever, I've got backups. But it's a pain.

---
Darkness cannot drive out darkness; only light can do that. Hate cannot drive out hate; only love can do that.
Martin Luther King, Jr.



[ Reply to This | # ]
HEEEEELP! DESKTOP CONTENTS ALL DISAPPEARED
Authored by: makh on Feb 23, '06 04:42:05AM

Please! Help.
Is there any way I can recover the contents of my desktop??
While I was hooked to my home Mac I tried to retrieve a file and couldn't find it.
Went back to my laptop and the screen was clean of all I had on the dsktop!
Can they be retrieved?



[ Reply to This | # ]
Fix a possible 'disappearing file on Desktop' bug
Authored by: skeeks on Mar 25, '08 04:52:35PM

Well, I apply the sudo the "rm -rf ~/Desktop" command and it did erase my Desktop folder, I relaunch my finder and it did recreated the Desktop Folder, my only problem is that I can't see any of it's contents directly in my desktop (as it was) plus I can't copy nothing to the desktop. Do anyone know how can I enable that function? Anyway, it's worst now!



[ Reply to This | # ]