parzivail / SGP.NET

C# SGP4 Satellite Prediction Library. Load satellites from TLEs, convert between coordinate systems and reference frames, observe satellites from ground stations, and more.
MIT License
33 stars 14 forks source link

Issue with caching provider and file access #20

Closed Kilowhisky closed 4 years ago

Kilowhisky commented 4 years ago

Hi,

I've encountered a problem when attempting to use this library in a web application. It appears that the caching provider drops the file in the executable folder which is write protected (for good reason). Is there a away to have it drop into a temp directory or a way to specify the directory itself?

parzivail commented 4 years ago

Absolutely. It should be possible to specify an absolute path instead of one relative to the executable as the filename, like so:

var provider = new CachingRemoteTleProvider(true, TimeSpan.FromHours(12), @"C:\path\to\your\folder\cachedTles.txt", url);

If this doesn't work, please let me know and I'll investigate it further!

parzivail commented 4 years ago

Closing this for now, if you're still running into this issue, feel free to repoen it.