Bug 160100 - Cache problems on windows with files that are only different in case
Summary: Cache problems on windows with files that are only different in case
Status: NEW
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: plan
: 185791 (view as bug list)
Depends on:
Blocks: 276103
  Show dependency tree
 
Reported: 2006-10-06 19:22 EDT by Michael Scharf CLA
Modified: 2020-07-23 15:20 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Scharf CLA 2006-10-06 19:22:09 EDT
- a remote unix system
- create a file a.txt and A.txt in the same directory
- windows as host
--> try to edit both files....
Comment 1 David McKnight CLA 2006-10-25 16:35:02 EDT
Kushal, I'm assigning this to you as I think you had recently looked at something to do with the conventions we use for storing temp files.
Comment 2 Kevin Doyle CLA 2007-05-07 15:46:01 EDT
*** Bug 185791 has been marked as a duplicate of this bug. ***
Comment 3 Kushal Munir CLA 2007-05-30 10:20:07 EDT
This has always been a problem. We'll need an alternative way to map filenames that are different only in case.
Comment 4 Martin Oberhuber CLA 2007-05-30 11:52:02 EDT
Would that caching problem also affect the EFS provider, or does EFS work around the file cache? (I think it does since it always returns streams... at least for ssh, I'm not sure about dstore)
Comment 5 Martin Oberhuber CLA 2007-07-12 08:45:42 EDT
I think this is something we should discuss at our F2F in Chicago.
Comment 6 Martin Oberhuber CLA 2007-11-07 16:18:00 EST
We should invent a different kind of path mapping, and perhaps store the RSE TempFiles outside Eclipse projects (bug 158770).
Comment 7 David McKnight CLA 2008-01-07 14:29:59 EST
Our approach for things like invalid characters (for windows) has been to store the temp file path using the escaped characters.  For handling stuff like files of the same name but different case we could do something similar (i.e. map the remote name to something different locally).  One problem we face with both the handling of invalid characters as well as case via name mapping, is that we can't control the name the eclipse editor shows.  When a file is opened in an editor, the FileEditorInput displays the name of the local file in the tab of the editor pane (and the full path in the tooltip).  

For example, if we had a scheme like
A.txt -> <upper>a</upper>.txt       
a.txt -> <lower>a</lower>.txt

We would stil end up seeing:
"<upper>a</upper>.txt" in the editor tab when viewing A.txt.

Another scheme could be like this:
A.txt -> .../upper/a.txt
a.txt -> .../lower/a.txt

With this scheme, we end up seeing:
"a.txt" in the editor tab but ".../upper/a.txt" in the tooltip.

Without control over the editors, I'm not sure how we can win with this one.


Comment 8 Martin Oberhuber CLA 2008-01-07 19:31:55 EST
What about an approach similar to how Windows maps file names to 8.3 names:
  a.txt --> a.txt
  A.txt --> a~1.txt
  A.TXT --> a~2.txt

i.e. any file or folder name that cannot be expressed directly in the file system for any reason is mapped to filename + some random postfix. A mapping table keeps track of the mappings between the abbreviated file names to the real (remote) names. Every directory in the RemoteSystemsTempFiles area could have one file (e.g. .mappings) that has the mappings.
Comment 9 Martin Oberhuber CLA 2008-01-07 19:35:53 EST
With respect to uppercase / lowercase mappings specifically, another approach could be like what we're already doing for connection alias names in the RemoteSystemsConnections area:

Given a file name like 
   abcdeFg.Txt
use a bitmask to specify which character position should be uppercase. In the example, it is the 6th and 9th characer, so 2^5 + 2^8 = 32 + 256 = 288
so the file name would be abcdefg.txt_288 i.e. append the bitmask as postfix. 

DaveD knows more about that mapping code. Naturally, the mapping gets problematic with file names longer than 32 characters. And, invalid characters would still need to be escaped.
Comment 10 David McKnight CLA 2008-01-08 10:08:14 EST
(In reply to comment #8)
> What about an approach similar to how Windows maps file names to 8.3 names:
>   a.txt --> a.txt
>   A.txt --> a~1.txt
>   A.TXT --> a~2.txt
> i.e. any file or folder name that cannot be expressed directly in the file
> system for any reason is mapped to filename + some random postfix. A mapping
> table keeps track of the mappings between the abbreviated file names to the
> real (remote) names. Every directory in the RemoteSystemsTempFiles area could
> have one file (e.g. .mappings) that has the mappings.

My point was that regardless of how we map the files, we're going to get editors that show the wrong thing in the name tab.  
Comment 11 Martin Oberhuber CLA 2008-01-08 10:22:15 EST
Right. Only a special kind of EFS provider could probably solve that, at the risk of not working in editors that do not support EFS properly.

Therefore, my proposal was to try and keep the mapped file name as close to the original file name as possible; users would still know what file was being edited, even if the file name does not exactly match the real name (it would still sort of match).
Comment 12 Martin Oberhuber CLA 2008-07-10 12:18:02 EDT
This is a nasty one that I'd love to see addressed in 3.1 -- we might need to create a plan item for all cache related issues to address.
Comment 13 Ryan CLA 2008-08-22 13:00:37 EDT
To weigh in, I personally think it's much less important to try and get the editor to show the correct file name at the top than it is to avoid data corruption. As long as I can click on a file in the Explorer and that file opens up in the editor, I don't care much if it has some funky filename listed at the top.
Comment 14 David McKnight CLA 2010-12-22 09:14:29 EST
Bulk moving 3.2.x bugs to 3.3
Comment 15 Martin Oberhuber CLA 2011-05-31 17:49:24 EDT
Bulk moving 3.3 deferred items to 3.3.1
Comment 16 Nobody - feel free to take it CLA 2020-07-23 15:20:44 EDT
Very related: #276897