EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How do I format SolFSWideChar on linux?

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
Posted: 08/01/2012 18:23:48
by Rafal Grasman (Basic support level)
Joined: 07/31/2012
Posts: 6

well in the compilation process there were many errors about wchar_t * being unable to be used with SolFSWideChar * so I casted them.
And I couldn't use L"string" because it was giving me error too, just here:

#if defined LINUX
   SolFSWideChar storname[19] = {'S','C','R','I','P','T','F','I','L','E','S','-','V','F','S','.','S','T',0};
   if( !(access( "SCRIPTFILES-VFS.ST", 0 ) != -1) )
#if defined LINUX
      result = StorageCreate(storname, False, 512, NULL, &storage, '/', False, False);
      result = StorageCreate(L"SCRIPTFILES-VFS.ST", False, 512, NULL, &storage, '/', False, False);

//somewhere else

#if defined LINUX
   SolFSWideChar tempdir[6] = {'/','t','e','m','p',0};
   StorageCreateDirectory(storage, tempdir);
   StorageCreateDirectory(storage, L"/temp");

that, I think is not a nice way to define cross compatible code :S

and here is an example of how i want to get the filenames..

char * g_sz_tmp;
SolFSWideChar g_sz_wtmp[257];
SolFSLongWord g_amount_read = NULL;
static cell AMX_NATIVE_CALL n_FileOpen( AMX* amx, cell* params )
   Handle File = NULL;
   wstringstream xxx;
   xxx << g_sz_tmp;
#if defined LINUX

this code messes up, all write operations work, most of the read operations work except my ReadBlock function on linux. the problem is that all the filenames are 1 character long when I open the storage with SolFS Explorer (though the written data in the files is actually good).

So how would I code this for linux?
People are getting excited about this project :)

The windows version works perfect.
Posted: 10/08/2012 06:17:13
by Rafal Grasman (Basic support level)
Joined: 07/31/2012
Posts: 6

the projects is located at http://gpb.googlecode.com and is named "VirtualDiskStorage_V1_RC1.zip" in the download section. The linux version is stillfacing this problem and I would like to fix it but I don't know how.
Posted: 10/09/2012 02:59:44
by Alexander Plas (Team)


SolFS uses UCS2 aka UTF-16 encoding for almost all strings. This encoding is same as wchar_t type in Windows, but not in *nix. Various version of Linux and BSD based OS use UCS4 aka UTF-32 as encoding for wchar_t. In the next build of SolFS for Linux, FreeBSD and Mac OS new function for string conversation will be introduced. You can use iconv functions for string conversation for now.



Topic viewed 3155 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!