Removing all the sub dierectories and files

i need ruby code to remove all the sub dierectories and files, but main folder should not delete

You need to look at the Dir class:
or perhaps the File class:

These classes contain methods to list and delete directories and files.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs