0

I have a file that contains 2 files, one of this file is a proprietary file that is read(c++) and written(c#) by two SDK. The problem is that SDK accepts only a string of the file path to access the file. Is there a method to obtain a virtual path of this file?

EDIT 0

I have a single file like this:

common header{ ... } 
file 1 { ... } 
file 2 { ... } 

The SDK only reads the file 2 by a path, but the path that i have is the path of the file container. I need to create a virtual path of the file 2 only.

EDIT 1 I have a file that contains the copy of 2 files and other information in the header. The SDK can access only the file 2 and only by a path string with its open file method. I need to create some kind of virtual path to this contained file.

  • Can you give us more details or some code, it's not clear what you're asking. Why can't you give the SDK the file paths? – Nanhydrin Jan 22 '19 at 10:54
  • I have a single file like this: common header{ ... } file 1 { ... } file 2 { ... } the SDK only read file 2 by a path, but the path that i have is the path of the file container. I need to create a virtual path of the file 2 only. – Giovanni L Santonicola Jan 22 '19 at 11:00
  • Ok so let me see if I've got this right, so you've got a text file with 2 or 3 classes in it, and you want to give the "path" to the `file 2` class to an SDK method? What is the SDK method expecting the path to be of, a text file or a compiled file? And if it's expecting a text file, what happens if you just pass the path of the container file into it? – Nanhydrin Jan 22 '19 at 11:05
  • no, i have a file that contains the copy of 2 files and other information in the header. The SDK can access only the file 2 and only by a path string with its open file method. I need to create some kind of virtual path to this contained file. – Giovanni L Santonicola Jan 22 '19 at 11:17
  • What is the SDK? I'm not sure that what you want to do is actually possible. – Nanhydrin Jan 22 '19 at 11:20
  • File SDK of a proprietary thermal camera. I also think that what i want is not possible but I need to have only 1 file that contains the proprietary and my extended file, and I also need to access the file with SDK. My solution was the file container, like the example. Is there any other solution? – Giovanni L Santonicola Jan 22 '19 at 11:30
  • Gotta love those camera SDKs ;) I also work a lot with them. Without understanding exactly what the SDK method is expecting and the content of the file I can't really suggest anything else. Unfortunately duplicating content and having the separate file may be the only way. – Nanhydrin Jan 22 '19 at 11:41

1 Answers1

0

I guess what u are looking for is this:

String RelativePath = AbsolutePath.Replace(Request.ServerVariables["APPL_PHYSICAL_PATH"], String.Empty);

Credits: Click here!

Mikev
  • 2,012
  • 1
  • 15
  • 27