In my user folder is a file with the name "1". When I open it in a text editor like Xcode, there is one line of text that reads:

button returned:OK

If I delete that file, it gets recreated after some time. My OS is 10.6.8

What is that file?

  • 1
    Looks like a log file of some kind, but without further information it's nearly impossible to find out where it's coming from. – nohillside Sep 6 '12 at 17:04
  • 1
    Just a note for developers who come across this problem in their own programs. This usually happens if you wanted to redirect stderr to stdout and mistyped 2>&1 as 2&>1. – user3490458 Aug 25 '16 at 11:34

It's impossible (given the information in your question) to know what is making the file, but you can set a trap for it and see what process is writing to that file and hopefully which one re-creates it if you catch that moment in the filesystem logging.

You'll need to know a few things about the terminal to use the tool fs_usage and filter the results to match the exact path of the file.

On my machine, my home folder is named mike, so you can adjust the |grep /Users/mike/1 command to match your user folder's name:

Open the terminal app and type pwd and press return. Then type the sudo command - this invokes the command as the super user (root) since it's tapping into the very lowest level of the system and bypasses the protections that all users have. If you don't like terminal commands, look into a tool like fseventer to see if you can determine what is creating that file.

mac:~ mike$ pwd
mac:~ mike$ sudo fs_usage | grep /Users/mike/1
12:48:19  stat64            /Users/mike/1                                                                    0.000076 W touch       
12:48:19  open              /Users/mike/1                                                                    0.000206 W touch       
12:48:19  getattrlist       /Users/mike/1                                                                    0.000119   mds         
12:48:19  lstat64           /Users/mike/1                                                                    0.000012   mdworker    
12:48:19  stat64            /Users/mike/1                                                                    0.000004   mdworker    
12:48:19  lstat64           /Users/mike/1                                                                    0.000002   mdworker    
12:48:19  getattrlist       /Users/mike/1                                                                    0.000041   mdworker    
12:48:19  open              /Users/mike/1                                                                    0.000025   mdworker    
12:48:19  getattrlist       /Users/mike/1                                                                    0.000012   mdworker    
12:48:19  getattrlist       /Users/mike/1                                                                    0.000078   mdworker    
12:48:19  getattrlist       /Users/mike/1/.DS_Store                                                          0.000006   mdworker    
12:48:19  getattrlist       /Users/mike/1/.DS_Store                                                          0.000003   mdworker    
12:48:19  getattrlist       /Users/mike/1/.DS_Store                                                          0.000004   mdworker    
12:48:19  getattrlist       /Users/mike/1/.DS_Store                                                          0.000003   mdworker    
12:48:19  getattrlist       /Users/mike/1                                                                    0.000024   mds         
12:48:20  lstat64           /Users/mike/1                                                                    0.000028   fseventsd   

You see I typed control-C to exit the tool since fs_usage will wait forever, dumping the usage of all files until you tell it to quit.

Once you've set the trap, just wait for the screen to show the entries similar to mine where I used the touch command to create the file ~/1

  • Thank you. Is there a way to write this to a log without having Terminal open? Because I don't know when the file will get recreated, and very likely by then I will forget to have Terminal running. Also, I started fs_usage and then opened a folder in the finder to navigate to my userfolder to delete the file, all of which created more than 400 lines in Terminal, all with stat64, getattrlist or open, all with "Finder" given as the executing application. Quite a few of those lines (about one fourth) give the path "/Users/username/1>>>>". – user28268 Sep 6 '12 at 18:25
  • Be sure to delete the file before running the fs_usage command. You could redirect the contents of the command to a file by adding `> /tmp/file.out' or whatever, but just minimize the window. The first entry will tell you who creates the file as you scroll back. If you are flooded with answers - just look at what process is using the file and be done with it, no? – bmike Sep 6 '12 at 18:27
  • When I open a file in Xcode, sometimes Terminal writes "21:36:32 getattrlist /Users/username/1 0.000014 Xcode" for a few lines. It does not happen every time, though. – user28268 Sep 6 '12 at 20:15
  • I no longer have OS 10.6.8, and I never managed to catch the creation of the file, because I forgot or was too lazy to start up fs_usage, but I accept this as the right answer, because it seems that it should have worked with a more diligent user than me :-) – user28268 Mar 8 '13 at 11:07

It looks like the output from an AppleScript dialog. For some reason, the return value got echoed to that file.

In any case, it's probably safe to delete if you don't want it laying around.

  • If I delete it, it reappears after some time. I don't run any AppleScripts, at least not knowingly. – user28268 Sep 6 '12 at 17:40
  • @what bmike's answer is better than mine. Try what he recommends and, if it helps, accept it. – Cajunluke Sep 6 '12 at 18:05

You must log in to answer this question.