Raised This Month: $32 Target: $400
 8% 

KeyValues.ImportFromFile failing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 08-05-2018 , 02:32   KeyValues.ImportFromFile failing
Reply With Quote #1

KeyValues.ImportFromFile is failing (returning false) on the Linux servers for a server community that I am currently helping out with. The function worked fine before their Windows-to-Linux migration.

So, my first thought was that this was a file permissions error. However,

PHP Code:
    char sConfigFullPath[PLATFORM_MAX_PATH];
    
BuildPath(Path_SMsConfigFullPathsizeof(sConfigFullPath), "configs/moreVoiceCommands/Scout.txt");
    
File file OpenFile(sConfigFullPath"r"); 
This works perfectly. Sourcemod is able to access the file, leading me to believe that this is not an issue with file perms.

Anyone have any ideas?

Attached is one of the files that is failing to import.
Attached Files
File Type: txt Demoman.txt (1.7 KB, 154 views)
__________________

Last edited by ddhoward; 08-05-2018 at 02:33.
ddhoward is offline
Rachnus
Senior Member
Join Date: Jun 2016
Location: Funland
Old 08-05-2018 , 07:08   Re: KeyValues.ImportFromFile failing
Reply With Quote #2

https://github.com/Rachnus/Entity-Sp...pawner.sp#L412

This works fine for me on a linux server. (CSGO)

PHP Code:
SourceMod Version1.9.0.6248
SourcePawn Engine
1.9.0.6248jit-x86 (build 1.9.0.6248)
SourcePawn APIv1 4v2 12
Compiled on
Aug  2 2018 14:32:33 
__________________
Github: https://github.com/jimppan
Steam: http://steamcommunity.com/id/jimppan
_____________________________________________ _________
Taking private requests

Last edited by Rachnus; 08-05-2018 at 10:55.
Rachnus is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 08-05-2018 , 10:45   Re: KeyValues.ImportFromFile failing
Reply With Quote #3

Not particularly helpful, but testing on TF2 and trying to match your paths, the failure happens inside the engine. If you pass true for OpenFile's third parameter so it uses Valve's stuff (like the KV function does), it will fail as well.

Edit: as far as I can tell, there might be a bug where the engine lowercases the path and so breaks it because your filesystem is case-sensitive.

Last edited by Fyren; 08-05-2018 at 13:01.
Fyren is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode