Touch a File (Before Creating It)

If you do any type of WordPress development for clients, then you’re likely familiar with having to work within many different environments.

Sure, the backend of each system may be very similar: That is, they are all running on some form of Linux with Apache or Nginx and MySQL. But, depending on the project that you’re working on, you may end up facing a variety of file permissions.

For example, let’s say that you’ve been hired to write a plugin or some custom functionality for someone and the work that you’re doing has to integrate with work that someone else has done. On top of that, it has to integrate with permissions on a file system that you can’t change.

Furthermore, a portion of the work you have to do must write a file to the disk. The problem? The code for saving a file isn’t working.

What then?

Continue reading “Touch a File (Before Creating It)”