Automatically Inhibit sleep while transferring files over the network? I was transferring some files over the network and my macbook pro just fell asleep. I had the "Wake for network traffic" in Preferences>Energy checked. I am using High Sierra. It doesn't sound like Apple not to prevent sleeping while you are conducting an operation. This a bug or a feature?
You can install 3rd part app Caffeine. you can turn it on to prevent your mac from sleeping. Other popular apps are Anti Sleep and Amphetamine. I'm pretty sure all 3 are free. Amphetamine is also available from the App Store. I personally use Caffeine and it works well. It adds a coffee cup icon to menu bar so you can easily turn it on or off.

Caffeine may actually come with newer system upgrades so check your Applications folder.