/ to C:\

If it doesn't fit anywhere else, drop it in here. (not to be used as a chat/nonsense section)

Moderator: Moderator Team

Post Reply
disks86
Posts: 35
Joined: Tue Mar 22, 2005 10:17 pm
Location: USA
Contact:

/ to C:\

Post by disks86 » Fri Feb 15, 2019 8:45 pm

Anyone off-hand know if it is possible to translate Linux style paths to windows style paths at the Windows level?

I know someone who is moving from Linux to Windows. All of the embedded scripts in an application they use have Linux paths though so I was curious if any of you were aware of a way to do that. (To be clear this application supports Windows and Linux so it's not a application compatibility question it's just the user's scripts that aren't platform agnostic)

I thought about a Filter driver but it is unclear to me if the path can be changed. Also I'm not sure if writing a driver would really be less effort than going through and changing all of the scripts.
Talk is cheap. Show me the code. - Linus Torvalds

ThFabba
Developer
Posts: 274
Joined: Sun Jul 11, 2010 11:39 am

Re: / to C:\

Post by ThFabba » Fri Feb 15, 2019 10:30 pm

The broken paths would never reach a filter driver, path validity is checked at a much earlier level.
In some scenarios, Unix-like paths will "just work", because Windows usually accepts / instead of \, and a path simply starting with \ refers to the current drive -- so /test can work as c:\test automatically. However there are various situations that can break this.
It sounds to me like the easiest solution here would be a few carefully crafted regular expressions to replace paths in those scripts.

disks86
Posts: 35
Joined: Tue Mar 22, 2005 10:17 pm
Location: USA
Contact:

Re: / to C:\

Post by disks86 » Mon Feb 18, 2019 4:37 pm

ThFabba wrote:
Fri Feb 15, 2019 10:30 pm
The broken paths would never reach a filter driver, path validity is checked at a much earlier level.
In some scenarios, Unix-like paths will "just work", because Windows usually accepts / instead of \, and a path simply starting with \ refers to the current drive -- so /test can work as c:\test automatically. However there are various situations that can break this.
It sounds to me like the easiest solution here would be a few carefully crafted regular expressions to replace paths in those scripts.
Unfortunately the scripts are embedded in this application so the user would be required to modify them all by hand. Thank you for replying.
Talk is cheap. Show me the code. - Linus Torvalds

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest