Can you give me some examples where Singletons can be avoided using other techniques?
In higher level code, simply create the instance directly, and pass that around. You should be doing this at as high a level as possible that still makes sense.
In lower level code, accept a reference to an existing instance as a parameter. Don't accept a factory if you can avoid it without ham-stringing your design, and definitely don't call a constructor/new
on things that aren't core to the logic of that class.
If you follow both these rules you'll implicitly manage the number of instances you create, and won't paint yourself into a corner by forcing a singleton design (that is often short-sighted to begin with).
How you would implement a file manager, resource manager, log manager, etc without singletons
I wouldn't. I'd create classes that could be instanced, and let the application itself call the shots on how many instances got created, and how they are created.
At the same time, I wouldn't let low level parts of my application call any shots. Just because I write to a log doesn't mean I have to know where it should be stored, what level of the logging hierarchy I'm writing to, what filters should be applied to it, etc.
I'd let the high level portions of my code decide these things. That way if I change my mind, I can scrap earlier decisions, blow away and recreate some top-level code, and not touch any of the code that writes to the log (the majority of my app).