Comment 20 for bug 110521

Revision history for this message
In , Mark Harrison (mark-z-harrison) wrote :

I've attempted to write an improved version of Jérôme Guelfucci's function (#3) for reading the .hidden file while imcorporating Brian J. Tarricone's critiques (#4). (Function to test if file is contained in .hidden) Unfortunately, I couldn't figure out how to compile thunar so I couldn't test this function. I hope this is useful in moving this bug towards resolution.

Basically, the last visited directory and a hash table of the .hidden file in that directory are stored in static variables. When a new file is checked, its directory (parent) is compared with the directory stored in the static variable. If they match, the current hash table is used. If they don't match, the hash table is destroyed and the .hidden file in the current directory--if it exists--is read into a new hash table. The hash table is then searched for the input file.

It has two limitations:

(1) It does not refresh if the .hidden file is changed in the current directory.

(2) The maximum length file name is 254 characters (specified by max_line_length in line 52). This is required by fgets when reading the .hidden file.