Menu

#887 Geany caches non-existing file

closed-invalid
nobody
Windows (49)
5
2012-09-24
2012-09-10
Anonymous
No

My syntax for perl files stop working after playing a little with syntax files and reboot. During searching for a reason of failure I found that Geany cached the file I opened before (filetype.perl.conf in Program Files) that does not exist any more. Syntax works correctly after Geany reinstalled but only for the first run.For second and future executions perl syntax doesn\'t work.
Non-existent file is listed in Open dialog from Geany and it\'s contents can be viewed with Geany. Image of Open dialog as seen from Geany is in attachment.

Geany 1.22 on Windows 7 64-bit.

Discussion

  • Anonymous

    Anonymous - 2012-09-10

    Weird. Can you give clear steps to reproduce? I can test on WinXP and Win7 but I have no clue what you did (step by step) to make this happen.

    Also, are you sure the file isn't just "hidden" and it's showing in Geany's dialog and not Windows Explorer?

     
  • Lex Trotman

    Lex Trotman - 2012-09-11

    The filetypes.perl file in the file manager does not have the same date/time as the filetypes.perl file in the Geany open dialog. I suspect they are looking at different directories.

    The Geany open dialog is probably looking at the user config directory. This is NOT cleared when Geany is re-installed (like most applications data) so changes you have made will not disappear until you delete them yourself.

    Since there are two filetypes files for Perl I'm not surprised its confused.

     
  • Anonymous

    Anonymous - 2012-09-24

    I can't provide all steps to reproduce the problem because I have no idea how to return to the working state. Now Geany understands syntax only at first start after reinstall.
    What I did was:
    0. Not sure but it may happen that I tried to modify filetypes.conf in program files with Geany before other steps.
    1. Copy filetype.perl to filetype.Perl.conf in program files
    2. Edit this file using Geany. File was marked as saved in Geany but permissions did not allow it to be saved. So original file was not changed on the filesystem.
    3. I remove file filetypes.Perl.conf from system directory and placed it to AppData/Roaming/Geany/filedefs and modify it. I am not sure if I use Geany to modify it at this point or other editor.
    4. Finally I remove all custom definitions (restore filetypes.conf in program files from saved file; remove all files from filedefs in AppData/Roaming)
    5. Create custom themes

    I will add another image with debug information from Geany. It is clear shows how Geany "sees" file before reinstall and does not see it after.

    This is list of files without using hidden attributes and with using them:

    C:\>dir C:\Users\olexpo\AppData\Roaming\geany\filedefs "C:\Program Files (x86)\Geany\data\*perl*"
    ...
    Directory of C:\Users\olexpo\AppData\Roaming\geany\filedefs

    09/05/2012 05:39 PM <DIR> .
    09/05/2012 05:39 PM <DIR> ..
    09/05/2012 05:39 PM 273 filetypes.README
    1 File(s) 273 bytes

    Directory of C:\Program Files (x86)\Geany\data

    01/03/2012 01:15 PM 4,320 filetypes.perl
    1 File(s) 4,320 bytes
    0 Dir(s) 107,121,111,040 bytes free
    C:\&gt;dir /AH C:\Users\olexpo\AppData\Roaming\geany\filedefs "C:\Program Files (x86)\Geany\data\*perl*"
    ...
    Directory of C:\Users\olexpo\AppData\Roaming\geany\filedefs

    File Not Found

    Directory of C:\Program Files (x86)\Geany\data

    File Not Found

     
  • Anonymous

    Anonymous - 2012-09-24

    Is it the Windows UAC[1] sneaking files around behind your back?

    "Applications written with the assumption that the user will be running with administrator privileges experienced problems in earlier versions of Windows when run from limited user accounts, often because they attempted to write to machine-wide or system directories (such as Program Files) or registry keys (notably HKLM). UAC attempts to alleviate this using File and Registry Virtualization, which redirects writes (and subsequent reads) to a per-user location within the user’s profile. For example, if an application attempts to write to “C:\program files\appname\settings.ini” and the user doesn’t have permissions to write to that directory, the write will get redirected to “C:\Users\username\AppData\Local\VirtualStore\Program Files\appname\settings.ini”. "

    [1] http://en.wikipedia.org/wiki/User_Account_Control

     
  • Anonymous

    Anonymous - 2012-09-24

    codebrainz, you are absolutely right! The files are there:

    Directory of C:\Users\olexpo\AppData\Local\VirtualStore\Program Files (x86)\Geany\data

    08/29/2012 02:47 PM <DIR> .
    08/29/2012 02:47 PM <DIR> ..
    08/29/2012 02:47 PM 5,321 filetypes.common
    08/29/2012 02:42 PM 4,782 filetypes.perl
    08/29/2012 02:27 PM 4,763 filetypes.perl.conf
    3 File(s) 14,866 bytes
    2 Dir(s) 107,120,152,576 bytes free

    Thanks for helping to resolve the issue. Now syntax works properly,

     
  • Colomban Wendling

    @apon: great you finally found what was the problem and solved it. However, are you sure you want to create a *new* Perl filetype? If you just want to modify a few settings in the existing filetype, you should just have a filetypes.perl in your user's configuration directory with the overrides you want in it, not a filetypes.Perl.conf that *defines a new filetype named Perl*. I'm not saying you don't want it, just that it looks wired to me.

     
  • Colomban Wendling

    • status: open --> closed-invalid
     
  • Anonymous

    Anonymous - 2012-09-24

    It was created by mistake before I was getting deeper into documentation. Now I understand that filetype.*.conf are used to define new types not listed in data folder.
    Maybe later I will copy filetypes.perl to user directory for customization. But now I don't need it. Geany team did a great work on unification of syntax and themes in latest version so now it is easy to create customized themes rather than customizing colors in filetypes.
    What I would change in default filetypes for perl are:
    - colors for arrays and hashes different from scalars;
    - comment_use_ident=false;
    - type=0 for [indentation].

    Thanks for clarifications.

     

Log in to post a comment.