What is creating a file with the name "1" in my user folder after I delete it repeatedly?

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?


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
/Users/mike
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   
^C

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


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.