I read INI file strings through GetPrivateProfileString API. However, the INIs in local windows directory could be read like that.
How can I read and edit a INI file in a Remote machine.
You should not expect to be able to modify INI files stored on remote machines. Whatever your problem is, this is not the solution.
I guess you're asking how to read a remote file (which is what this would boil down to). The easiest option if it's available is probably to just read the file using a remote UNC file path, e.g. \\SomeMachine\SomeShare\TheFile.ini. If you can't do that, you need to figure out a way to transfer the file to the local machine, either out of band or on demand using named pipes, TCP sockets, or something similar.
Why are you using INI files anyway? They were essentially deprecated after the 16-bit Windows era. I'd highly recommend a different approach (e.g. the registry, an XML config file, ...).
I only found out recently that you can't access INI files on UNC paths.
My solution was to map a drive letter to that location and it worked.
So instead of
\myserver\myinipath\myinifile.ini
I mapped X to that location...........
net use x: \myserver\myinipath
in case you need to login to that UNC path/server then
net use x: \myserver\myinipath /user:loginname password
I now use x:\myinifile.ini
Related
I am new to MariaDB and need to do below activity.
We are using MariaDB as datatbase and we need to read a txt file from ftp location. Then load into a table. This has to be scheduled to read the file on a regular interval.
After searching I got LOAD DATA INFILE to be used, but it has the limitation that, it can't be used in Events.
Any suggestions/samples on this would be great help.
Thanks
Nitin
You import it and read it using the local path, MariaDB does basic file support, in no case it supports FTP transactions
LOAD DATA can only read a "file". But maybe the OS can play games...
What Operating System? If the OS can hide the fact that FTP is under the covers, then LOAD DATA will be none the wiser.
I want to create HSQL embedded database but jdbc:hsqldb:file:"What should I write here to work on other PC". If I copy my project to another pc and click the jar file , it needs to access my database. So, what should I write for file path ? My application works on my PC but does not work on other PC because it does not access the database.
Please help me. Thank you.
If you're trying to access a file that isn't located on the same machine, you're most likely out of luck, unless you can set up a link, file sharing, etc.
If you want to make the file location configurable, then use a system parameter, a config file value, etc. and construct the JDBC string from that, e.g.,
java -jar some.jar -Ddb.location=/some/file/path
...
String url = "jdbc:jsqldb:file:" + System.getProperty("db.location");
If you want to access a DB server then you're probably going about this the wrong way.
I need to create a "virtual file", a file that if some program access that file, e can answer the size, permissions, and 'say' what is writen in it.
Why?
I have a Virtual Machine that have and Virtual Hard Disk, and i need that file be a 'link' to other and far location (unknow by Virtual Machine Program)
When the VM try to read, i need to 'say' what is writen, and when it´s try to write, i need to store in other location.
In most cases the file is in a network and splited in many computers (like a Network FileSystem) then i need to know every change/access/read in file and deal with the request.
I can't modify/inject the target program (third-party).
I found a question in this site about Virtual File, but i need to know in real time all changes in the file.
I searched for File Hooks and found nothing.
I tryed to use a virtual driver, but it´s hard to find some code (like Daemon Tools, but with Read/Write).
I thought in a remote folder (or mapped drive) with FTP, but the file size is TOO big (10-50 GB) and i need to read specific sections of the file.
Thanks in advance for any help.
(Windows)
What you are looking for is called a Filter Driver.
I want to essentially make it so that you never need to unzip/unrar any files. Currently, I have a Dokan filesystem which can do it given a specific zip file but I wanted to know how I can make it apply to all files. Meaning, I want to be able to compile a program that has "fopen("test.zip/1.jpg", "rb");". I think that a Shell Extension would work for dynamically loading the file into the filesystem IF I were browsing in the shell explorer but that doesnt help me with the fopen example. Any ideas?
What you want to do can be used with help of file system filter driver, which would track directory enumeration requests and report directories in place of ZIP files. Then this driver would create virtual files and take the data from ZIP archives. Quite a lot of kernel-mode work, I should say. And file system filter driver is not a file system driver, so dokan won't help you at all.
from my slapd.conf file, i see where my data is stored. when I look into that data directory i see two kinds of files, one type are .bdb files which appear to be the data files as that is the extension defined in the config file. But, I also have a bunch of log files, which appear to be binary when I try to read them in vi. I'm not sure if they are supposed to be there or if this is an oversight by someone previous to me. If I want to restore from an .ldif file, am I loosing anything by deleting all the log files? do I just need to delete the bdb files?
They are Berkeley DB files.
On Ubuntu 10.04, for example, you can install the db4.7-util package and get some information using the various db4.7_* utils (e.g. db4.7_dump or db4.7_stat). This being said, the structure of the database really depends on how OpenLDAP is coded (it's an internal format, so it's not particularly useful unless you really want to dig into it).
If you want to restore from an LDIF file, use LDAP clients or OpenLDAP commands such as ldapadd.