I'm writing a plugin that requires taking data from a custom admin menu and writing it to a text file. The data is not actually being written to the file, but no error or warning is being thrown. The file is in a different directory from the plugin, but the code can access and read the data file, not only without throwing an error, but also successfully echoing back the data already in the file.
The file's permissions are set to allow the server to write to the file. A php file in the same directory as the plugin file, but in a standalone PHP script (not part of a WordPress plugin), can write to the file.
The data file was opened using both fopen(,"r+") and fopen(,"w"). In both cases, fwrite() returns an integer but the file does not change, nor does the modification date.
ftruncate() was tested to see if the problem was specific to fwrite(); it returned 1, but the file was unmodified. The modification date, again, remained unchanged.