Help - Search - Members - Calendar
Full Version: Automatically Resolving Windows Paths To Linux
Linuxhelp > Support > Technical Support
gazzy
My problem needs AUTOMATIC resolution of WINDOWS paths (with drive letters et al) to pre-configured LINUX paths on RedHat 9.0 machines. Specifically, I have a third party application (running on both Windows and Linux platforms), which generates data files with embedded file paths corresponding to the particular OS file naming system. Consider the following example. Say, I create a data file using my application (lets call it X) on Windows XP. The contents of the data file will look as follows:

#Data file for application X
.......
.......
.......
.......
exec "C:testdirbinabc.xyz"

Now, I need to process this same data file on a RedHat Linux 9.0 box. The problem is that Linux does not use drive letters, it is case sensitive and the slashes are also different. So, the embedded file path won't be resolved correctly by Linux. This is the crux of my problem.

So, what I am looking for is some Linux app ,which can be configured to maintain a table of Windows path mappings to their corresponding Linux counterparts. It would look something like this:

WINDOWS FILE PATH LINUX FILE PATH
C:SAMPLEexample1.txt /tmp/example1.txt
D:example2.txt /tmp/example2.txt

This app can then inform the OS of the configured drive mappings. SO, whenever the RH 9.0 OS encounters the Windows style file paths it looks up the table (might need a kernel mod for doing that) and resolves it to the correct Linux file path (provided it has been configured in the table).

Is there any such Linux app out there? I can solve my problem by writing scripts to read through the entire data file and perform the file path replacement wherever necessary. However, the problem is that the data files are huge (> 100 MB) and therefore the aforementioned solution becomes really expensive.

Any help in this regard will be highly appreciated.

Thanks & Regards,
michaelk
It is probably possible but not realistic. IMHO it really is an application problem.

What do you mean by >100mb? Is the file < 200mb <500mb < 1gb? If you have a script that works then you could write a c program that would be faster. (Depends on file format of course). Just open the data file, move to the end of file less the last line, change it, save it and your done.

How does the script solution become expensive? It does take a lot of time to loop through files but the computer is doing all of the work.

Do you have the source code to the application?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.