script or whatever to delete the files and clean up any empty
directories once that is done.
The following may be easier -- at least I think it is.
1. Open the installer package in the Receipts folder.
2. Cmd-I to get the bill-of-material window.
3. Click on the window title.
4. Cmd-A to select the whole file list
5. Cmd-C to copy it to the clipboard.
You can then paste the list into your favorite text editor and save it.
Regards, Morton
Thanks. I used your tip to copy the file names to a file in the current
directory. You don't need to click on the window title, though--you can
click anywhere on the window and then hit <apple>A to select all the
file names.
In case anyone else would like to use it, the following is what I used
to uninstall all the files installed by the mac one click installer.
Look how easy it was!
One small point I meant to bring up earlier - when I've written scripts
like this in the past, I always have the script *move* the files to a
temporary location rather than deleting them directly. That way I can
inspect everything and delete them by hand if everything checks out
ok...
Maybe that's overly paranoid but having a script delete something
important by mistake really sucks...
One small point I meant to bring up earlier - when I've written scripts
like this in the past, I always have the script *move* the files to a
temporary location rather than deleting them directly. That way I can
inspect everything and delete them by hand if everything checks out
ok...
Maybe that's overly paranoid but having a script delete something
important by mistake really sucks...
One small point I meant to bring up earlier - when I've written scripts
like this in the past, I always have the script *move* the files to a
temporary location rather than deleting them directly. That way I can
inspect everything and delete them by hand if everything checks out
ok...
Maybe that's overly paranoid but having a script delete something
important by mistake really sucks...
Delete 1500 files by hand?
Ah. I think I get what you mean now. Instead of deleting the files,
you would have the program collect all the files in a new directory.
Then after running the program if the original ruby install works
correctly, you know you can safely run another program to delete all the
files in the new directory.
One problem I see with that is: if your original ruby install failed to
work correctly, you won't have any idea how to put everything back
together again. In order to know how to put all the files back in their
previous locations, you would have to do something like create a file in
the new directory which lists the original path of the each file and the
new path. Then you could create a program that reads that file and
moves all the files back to their previous directories. Or is there an
easier way?
Ah. I think I get what you mean now. Instead of deleting the files,
you would have the program collect all the files in a new directory.
Then after running the program if the original ruby install works
correctly, you know you can safely run another program to delete all the
files in the new directory.
Exactly ... stage the deletes somewhere like ${HOME}/temp_delete and, if
everything looks ok do a simple rm -rf ...
One problem I see with that is: if your original ruby install failed to
work correctly, you won't have any idea how to put everything back
together again. In order to know how to put all the files back in their
previous locations, you would have to do something like create a file in
the new directory which lists the original path of the each file and the
new path. Then you could create a program that reads that file and
moves all the files back to their previous directories. Or is there an
easier way?
There is an easier way Preserve the path underneath the temp root...
something like:
def delete_to_stage(file)
destdir = File.join(TEMPROOT, File.dirname(file))
FileUtils::mkdir_p(destdir)
FileUtils::mv(file, destdir)
end
Then you know exactly where things go back if need be...
def delete_to_stage(file)
destdir = File.join(TEMPROOT, File.dirname(file))
FileUtils::mkdir_p(destdir)
FileUtils::mv(file, destdir)
end
Thanks. I was just playing around with mkdir_p(I was actually using the
alias mkpath). I tested it out on my test directory structure(from
above), moving the files from those directories into another
directory--keeping their paths intact--and it worked nicely. One thing
I discovered: join() doesn't work in this case. You are trying to join
something like: