Checks the status of an attachment directory and returns an array of the status key, if that status key signifies an error, and the folder size.


array attachDirStatus (string $dir, int $expected_files)

Parameter $dir

Expected type: String
Description: The path to an attachment directory

Parameter $expected_files

Expected type: Integer
Description: How many files SMF expects to be in the directory (based on how many attachments in the DB are listed as being there)

Return value

Expected type: Array
Description: Returns an array with status key, whether or not that status key indicates an error, and total size

Array Elements
Key Optional Expected type Description
0 no Enumerated String 'does_not_exist' (error), 'not_writeable' (error), 'files_missing' (error), 'unused' or 'ok'
1 no Boolean Whether or not the status key indicates an error (those with "(error)" are error statuses)
2 no Mixed Total size of all files in the directory (in kilobytes) or an empty string if there's an error


  • Called from list_getAttachDirs
View all versions of this function