I have made a small app for a client. The app scans a files
directory which contains several text files. It then reads each file into a string. Every file has a title and the article text. The two parts are separated with a pipe character like this: article_title|article_text
. The script displays a list of links to open each article. The text of the link is the same as the article title.
Now, the client has apparently deleted an article, but is seein开发者_如何学运维g an entry for the deleted file like the image bellow:
I searched for the string on the web and could actually find pages showing similar strings, e.g. here which is apparently a deleted blog post.
What could be the cause for this? Is the file really deleted?
P.S.
- The client has set the app on an intranet and cannot give me access, he sent me a screenshot.
- I also don't know what his server OS is.
- I'm not sure what to tag this question, maybe you can change the tags to better ones.
OK, I found what it is. One of the Google search results pointed to this Which contains the following:
Bud1 ... @Ђ @Ђ @Ђ @E DSDB `Ђ @Ђ @Ђ @
Interestingly, the file is a .DS_Store
file! I checked a few .DS_Store files and they all contained the mysterious characters. These (hidden) files are generated automatically by Mac OS X. So the client should have accessed the folder from console and caused the creation of the hidden DS_Store (remember it's an intranet).
For people that is still getting trouble with this in your application (after removing a file in my case), I solved it by removing recursively the .DS_Store files in the project folder.
On terminal, go to the project:
cd to/your/directory
And just type:
find . -name '.DS_Store' -type f -delete
credits to Jon Bellah on his blog https://jonbellah.com/articles/recursively-remove-ds-store/
This is information that the Finder (Mac equivalent of Windows Explorer) stores about files and folders. The best description of the format I found was here:
https://metacpan.org/pod/Mac::Finder::DSStore
The format is described as:
The .DS_Store file holds a series of records giving attributes of the files in the directory or of the directory itself (referred to as .). These records are stored in a B-tree, and the pages of the B-tree are stored in the file by a "buddy allocator" along with a small amount of metadata. The allocator also provides a level of indirection, from small integers to file offsets, presumably allowing blocks to be relocated as they grow and shrink.
精彩评论