Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Auto creating folder if it doesn't exist  (Read 3000 times)

0 Members and 1 Guest are viewing this topic.

paupav

  • Full Member
  • ***
  • Posts: 156
    • View Profile
    • Email
Auto creating folder if it doesn't exist
« on: December 28, 2014, 02:43:58 pm »
When you are saving something like screenshot using sf::RenderWindow::Capture() and when you are trying to save it to some folder and if that folder doesn't exist, why doesn't it get create it?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Auto creating folder if it doesn't exist
« Reply #1 on: December 28, 2014, 02:56:55 pm »
Because SFML is not a filesystem library, and therefore it doesn't manage this kind of extra behavior.
Laurent Gomila - SFML developer

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Auto creating folder if it doesn't exist
« Reply #2 on: December 28, 2014, 05:07:24 pm »
Because it's a very obscure/rarely needed feature and there is no easy way to do it without either a filesystem library or OS specific calls.
Back to C++ gamedev with SFML in May 2023

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Auto creating folder if it doesn't exist
« Reply #3 on: December 28, 2014, 05:13:03 pm »
Also, some users might explicitly want the folder not to be created. This is much better handled in user code rather than in the library.