Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to delete zero byte files

I have several files on my desktop that are greyed-out that I can't delete in any of the normal techniques. It doesn't affect performance (as far as I know), but is just annoying that they are there at all. The attributes are strange. (1) Creation date is 1969, December 31 at 16:00. (2) Sharing & Permissions list me (admin user) twice, and once indicates that I have "Custom" access (whatever that is). I cannot change or delete any of these attributes. I get an error message reading saying "Image xxx is in use by Mac OSX and can't be opened". What might be using it?


Any idea of how to get rid of these (or how they originated) would be appreciated.


Czet

Mac Pro, OS X Mavericks (10.9.5), MacPro 5,1 (mid 2010); 16GB RAM

Posted on Feb 12, 2015 4:44 AM

Reply
17 replies

Jun 11, 2017 9:07 PM in response to Linc Davis

I tried the above, and remembered to include a space. The terminal window's response was: No such file (and then it quoted back to me the file and directory structure to it). It's a zero byte file, but it's not greyed out.


When I try to just delete it, I get "you don't have permission, but the file itself in Get Info says "You have custom access" and there is no lock icon to unlock the file permissions and adjust them. Perplexed. Can you offer a suggestion? Thanks in advance.

Jun 12, 2017 6:28 AM in response to TomEagles

TomEagles

I tried the above, and remembered to include a space. The terminal window's response was: No such file (and then it quoted back to me the file and directory structure to it). It's a zero byte file, but it's not greyed out.


When I try to just delete it, I get "you don't have permission, but the file itself in Get Info says "You have custom access" and there is no lock icon to unlock the file permissions and adjust them. Perplexed. Can you offer a suggestion? Thanks in advance.

Linc no longer participates in the forums.


If your file name or the directory path to the file has a space in it, you will need to put quotes around the path to the file.


/bin/ls -dleO@ "/path/to/your/file name"


should work


This ls command should tell us everything about the permissions on the file.

Jun 14, 2017 7:16 AM in response to BobHarris

Yep, that's what I did. Still getting "No such file or directory." <sigh> This file and its folders don't want to be deleted, even though after trying this several times, the folders allowed me to rename them, but the file didn't. But because the file is in the last branch (folder) in the tree, I also can't delete any of the folders. Perplexing. I love my Mac, but problems like this didn't happen on my PC.

Jun 14, 2017 7:26 AM in response to BobHarris

It's a network drive (Seagate GoFlex). Disk Utility won't work on that drive (or am I mistaken?). That said, I did format the drive for Apple rather than Windows.. wait (that was a local USB drive)... now I can't recall whether that one was formatted for Apple. Is there a way to confirm that? And since the problem file is on a Seagate network shared drive, would it matter anyway what the filesystem is?

Feb 12, 2015 4:03 PM in response to Czet

Back up all data before proceeding.

Select the text on the line below by dragging across it. Don't include the blank space at the end of the line. Only the text should be highlighted.

xattr -d com.apple.FinderInfo

Copy the selected text to the Clipboard by pressing the key combination command-C.

Launch the Terminal application in any of the following ways:

☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)

☞ In the Finder, select Go Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.

☞ Open LaunchPad and start typing the name.

Paste into the Terminal window by pressing command-V, then press the space bar.

Now switch to the Finder and and select the item(s) in question. Drag into the Terminal window. More text will be added to what you entered.

Click in the Terminal window to activate it, then press return.

Wait for a new line ending in a dollar sign ($) to appear. You can then quit Terminal. Try again to delete the files.

Feb 12, 2015 4:44 PM in response to Linc Davis

Linc,


I got excited when I received your instructions, because I thought this could be solved using some Linux commands (which I know, not at all.) However, it failed. Here's confirmation of what I did:


MacPro-Upstairs-2:~ Czet$ xattr -d com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG /Users/Czet/Desktop/IMG_1661.JPG /Users/Czet/Desktop/IMG_1662.JPG /Users/Czet/Desktop/IMG_1663.JPG /Users/Czet/Desktop/IMG_1664.JPG /Users/Czet/Desktop/IMG_1665.JPG /Users/Czet/Desktop/IMG_1666.JPG /Users/Czet/Desktop/IMG_1667.JPG /Users/Czet/Desktop/IMG_1668.JPG /Users/Czet/Desktop/IMG_1669.jpg /Users/Czet/Desktop/IMG_1670.jpg /Users/Czet/Desktop/IMG_1671.jpg /Users/Czet/Desktop/IMG_1672.jpg /Users/Czet/Desktop/IMG_1673.JPG /Users/Czet/Desktop/IMG_1676.JPG /Users/Czet/Desktop/IMG_1680.JPG /Users/Czet/Desktop/IMG_1682.jpg

xattr: /Users/Czet/Desktop/IMG_1661.JPG: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1662.JPG: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1663.JPG: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1664.JPG: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1665.JPG: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1666.JPG: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1667.JPG: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1668.JPG: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1669.jpg: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1670.jpg: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1671.jpg: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1672.jpg: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1673.JPG: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1676.JPG: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1680.JPG: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

xattr: /Users/Czet/Desktop/IMG_1682.jpg: No such xattr: com.apple.FinderInfo/Users/Czet/Desktop/IMG_1660.JPG

MacPro-Upstairs-2:~ Czet$


Chet

How to delete zero byte files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.