[TYPO3-english] two questions about table sys_file

Christian Reiter cr at cNOSPAMxd.de
Tue May 26 18:32:58 CEST 2015


Am 26.05.2015 um 15:42 schrieb bernd wilke:
> 1. I have (in a readonly-storage) multiple file renames: name changed
> from mixed case (with special signs) to lowercase (alphanum).
> is there an easy way to update the sys_file entries?

So this means the files were renamed by a process working outside of the 
TYPO3 backend?

Then I guess the following will work if only the filenames have changed:

Filesize and sha1 hash should have stayed the same.

So you could write a small script that

* first scandir's your filessystem recursively and register the filename 
(basename), path (dirname), filesize and sha1 of file content.


* then through your sys_file records for that storage, for any entry 
where file_exists() fails for the given storage + identifier, check if 
you have a file with the same sha1 from scanning your directory.

* Now if that also has the same filesize and dirname but only a 
different basename you are 111% sure it's really the same thing and you 
can change the sys_file record to point to it.





More information about the TYPO3-english mailing list