My plan is to prepopulate a database on a virtual device and then include database in the distribution of my app.
However, I can't find the database file.
Is it on my hard disk some where?
How do I get it?
I tried connecting using adb, I did an "ls" and then got really scared by this obscure list of directories:
sqlite_stmt_journals
cache
sdcard
etc
system
sys
sbin
proc
init.rc
init.goldfish.rc
init
default.prop
data
root
dev
Even when I cd over to /data/data/your.package.here/databases I still do not have access to the actual database file. I can't use sqlite3 or do a pull on it. Is there a way to change permissions?
This works fine on my emulator, but fails on the actual device
adb pull /data/data//databases/mydb.db .
It should be in /data/data/your.package.here/databases, where your.package.here represents the package associated with your application, as defined in your AndroidManifest.xml file.
If you want to navigate to your database (which is located /data/data/your.package.here/databases), make sure you are a root user while navigating shell. To do so, type "su" once you enter the command prompt. When you are a root user, you can navigate wherever you want.
The blog post below gives a good solution of how to find and access your database. The post talks about using busybox, which provides useful utilities at the command line, to find your database and gives a few useful examples on how to use sqlite3 to access the DB and tables.
http://davanum.wordpress.com/2007/12/11/android-how-to-poke-around-the-sqlite3-databases/
Related
I'm conducting a study and I need to store some data. I found an open source data scraper and parser online: https://github.com/hicsail/materials
I've followed some instructions (some of which but not all came from here) and
installed Postgres, created a docker-compose.yml file, and created a config file:
Above is the config file, and this is the .yml file
I started by going into the pgAdmin folder and running "docker-compose up", after which, this was the result:
I'm not sure if the "no privileges flag" means anything. Anyway, after this, I opened up a localhost:5050 in my browser and logged into pgAdmin.
I named the database "materials" as this was what it was supposed to be named.
Same thing with the username and password; both were named "root". However, when I run the command to parse the data, I'm getting this error:
I've been stuck on this for a long time now, and I can't seem to find any solution. This is running in a python2.7 conda environment, as per the requirements. These were the other installed libraries (I'm not 100% sure those were the exact versions, but I tried to get them as close as possible).
psycopg2==2.7.3.1
requests>=2.20.0
SQLAlchemy==1.0.9
wheel==0.24.0
If I need to clarify anything please let me know.
Thanks.
I found an answer for this. I had to go into services, then to postgres, and stop it from running. I then had to kill the port "5432" and run it again.
I have a macOS C program which is a helper app. It runs as root and has sticky permissions.
One of the jobs of this program is to backup files to an external USB drive.
When I run the program from a terminal window... it works perfectly.
However, when invoked via a web admin page (eg., via the web server), it fails to run with an "operation not permitted".
This is on the latest macOS. I've set the drive to be "ignore ownership on this volume". The drive in /Volumes is also 777.
So... when the process is invoked via the web, the user/group is both _www. It appears that no matter what, the process invoked via _www can't write to the USB stick.
To be more specific... it can't create any new files. It CAN overwrite existing ones. It can't mkdir either.
I've googled my brains out and no solutions seem to work.
Any help would be appreciated!
Ok, I found the solution here.
Open System Preferences and go to Security/Privacy and then click Full Disk Access from the left side and enable the httpd access from the right side.
Thanks!
Trying to track open files\locks on a server due to application issues. I can use Computer Management\Shared Folders\Open Files and see this data. The fields I get are:
Open File, Accessed By, Type, # Locks, Open Mode
Using this tool, I can export the list to a CSV. In trying to come up with a batch file to do it automatically, I found OpenFiles.exe. The script works fine, the issue is I only get these fields:
ID, Accessed By, Type, Open File (Path\executable)
There is no option with OpenFiles.exe to get the #Locks data. Which is frustrating, considering the data I want is right there in the Windows tool! Has anyone previously tackled this issue?
Try out the Handle utility from System Internals at https://learn.microsoft.com/en-us/sysinternals/downloads/handle
You should be able to get all of the information you are looking for with this command:
handle.exe -a -u -s
I have created a winform application and programmatically trying to attach the database when an application runs first time. Unfortunately in windows 7 i always got an error. Please view the screenshot below it tells the whole story. Now my question is that how can i get rid from this error, is there any way to automatically give required rights on the folder where the application installs?. I want to permanently resolve this error and need smooth attachment. Anyone please help.
Please view the error below. Thanks in advance
Try ALTER DATABASE MyDatabaseName SET READ_WRITE
More informations here on This forum
Edit
This was asked by someone else
If you put your database in your own subdirectory of the directory returned by Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData then the user will have read/write access to it.
See Environment.SpecialFolder Enumeration to determine if a different location would be more suitable, e.g. ApplicationData if you need it to roam or CommonApplicationData if you need all users of the computer to use it.
Edit: I found a slightly more extensive version of this answer: Where Should I Store my Data and Configuration Files if I Target Multiple OS Versions?, please also see the articles it links to.
I know this answer is somehow late, but I believe people always face the same problems so my case is worth to be shared.
tl;dr = Change the permission of deployed files manually or using icacls command.
Actually I use InstallForge for packing and deploying my application(s).
No matter what setup creator is used, when the application is installed to a non-system folder ( e.g. D:\ ) the program works perfectly and the database is readable/writable.
Whereas when the application is installed in [Program Files] folder or [Program Files (X86)] folder, Windows takes a preventive security measurement and sets file permission to be only [Read] and [Read & Execute].
I think Windows Vista and later versions of Windows have this behavior.
You can check that by right-clicking the installed file and going to properties then Security tab.
The files I installed on D:\ had Full-Control permission while, as I mentioned, the ones on C:\ had only Read & Execute permissions.
You won't notice the difference when you install a normal program on C:\ because you might not be writing data on a file or a database. But in case of database deployment, the file has to be writable.
Finally, the solution for this case was telling InstallForge to change file permissions at the end of the installation using icacls commands :
icacls "C:\MyApp\MyDB.mdf" /Grant Everyone:F
icacls "C:\MyApp\MyDB_log.ldf" /Grant Everyone:F
In my case, it is okay to give everyone full-control on the database files, but you might need a customized solution for your case so please refer to :
http://ss64.com/nt/icacls.html
You can tell your setup creator to run those commands, or you can put them together in a batch file and run it after the installation.
Whenever I open one of the Quantum Grid demos in Delphi XE Pro (on Windows 7 32-bit), the following error is displayed for every table (I think) in the project:
error message http://www.tranglos.com/img/qgerror.png
The message is:
Network initialization failed.
File or directory does not exist.
File: C:\PDOXUSRS.NET
Permission denied.
Directory: C:\.
I understand permission issues writing to c:\, but the result is that while I can build and run the demo projects, no data is displayed, which makes the demos rather useless. And what kind of database writes its configuration to c:\ directory in the 21st century anyway? :) (Yes, I know very little about Paradox databases, but I won't ever be using one either. I just want to learn how to use the grid.)
Using BDE Administrator I've tried changing the Paradox "NET DIR" value to a folder with write permissions on the C drive. Result: now the database tables cannot find their data:
Path not found.
File: C:..\..\Data\GENRES.DB.
...and the unhelpfully truncated path gives no indication where the files are expected to be.
Is there a way to work around the problem so that the demos can load their sample data correctly?
Did you install the BDE correctly? It should use the DBDEMOS files. Do you see such an alias in the BDE administration utility? Can you open that database in one of the Delphi demos?
The BDE is not a XXI century database, it was developed twenty years ago and never upgraded lately. It's an obsolete tecnology, but because it comes still with every release of Delphi with a known database it is still often used in demos because nothing new has to be installed.
Anyway that file is not its configuration file. It's a sharing lock file to allow more than one user to use the database concurrently. Because it is a file based database without a central server, it has to use such kind of shared files. Usually its position is changed to a network share, but it defaults to C:\ for historical reasons.
Anyway it's not only the BDE still attempting to write in the prong directories. I still see a full bunch of applications attempting to write to C:\ (especially logs) or other read-only positions.
Using BDE Admin to change the location for PDOXUSRS.NET helped, but it wasn't sufficient. DevExpress did the right thing in specifying a relative folder for the data location, and the relative folder seems perfectly allright, but for some reason the DB can't find it.
Solution: under the \Demos\ folder find all the *.dfm files that contain the string
..\..\Data
and replace that string with the absolute path to the demos folder. That done, all the demos open correctly.
I know this message from our own applications. It has to do with security measures introduced with Windows Vista. The operating system trying to protect critical files denies access to them. There is a method how to bypass this mechanism without compromising security. Try to run your application in compatibility mode. When application is running in compatibility mode, read / write operations from / to system folders are redirected to "safe" directories located in C:\Users[Current User]\AppData\Local\VirtualStore.
More info on http://www.windowsecurity.com/articles/Protecting-System-Files-UAC-Virtualization-Part1.html.