Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
file create chmod?
  • Hi, Is it normal you can't set the chmod when creating a file? (as you can with creating directories)
    You have the option to update a file :) Regards
    EDIT:
    I use this for the moment
    if (file_exists(DOCROOT . 'assets/doc/prijslijst.xls'))
        {
         File::update(DOCROOT . 'assets/doc', 'prijslijst.xls', $data);
        } else {
         File::create(DOCROOT . 'assets/doc', 'prijslijst.xls', $data);
         chmod(DOCROOT . 'assets/doc/prijslijst.xls', 0777);
        }
    

    I just find it weird that you can't set the chmod while creating the file
  • Hey, I must say, that one of server the client was using, I also could not set the permissions of the file, while creating it, only running separate chmod() command. I was using plain php commands (it was not framework dependent) I have never figured out why it won't work, because I found out that chmod()'ing it worked so I left it as is... if you find the issue, please share with us :)
  • Muts, You are correct there are no parameters for chmod in the file create method only directory creation. May be a nice to have do a pull or post a feature request on git.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion