错误地使用了当前的工作目录...我的数据库到底在哪里? [英] Used current working directory by mistake... Where the heck is my database?

查看:110
本文介绍了错误地使用了当前的工作目录...我的数据库到底在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道为SQLite数据库设置数据库名称意味着设置DB文件的路径. 我是这样设置的:

I know that setting the database name for a SQLite database means setting the path to the DB file. I set it like this:

db.setDatabaseName("DienstplanerDB.sqlite");

  • 这是错误的

    • this is wrong

      这不是怎么做

      但是我做到了

      以某种方式起作用,但是我无法通过Finder或Spotlight找到创建的文件.

      And somehow it worked but I could not find the created file via Finder or Spotlight.

      编辑

      它在应用程序包中,请参阅下面的答案以获取信息. 另外,请参阅库巴·奥伯(Kuba Ober)和贡巴特(Gombat)的答案,以获取有用的建议.

      It was in the app package, see my answer below for information. Also, see Kuba Ober's and Gombat's answers for useful advice.

      推荐答案

      一个sudo find / -name "DienstplanerDB.sqlite"指出数据库是在应用程序包中创建的.

      a sudo find / -name "DienstplanerDB.sqlite" spit out that the Database was created within the app package.

      如果要访问它,请右键单击"YourPorgram.app",然后选择""显示包内容" .

      If you want to access it, right click on the "YourPorgram.app" and select "Show package content".

      可以在Contents/MacOS/yourDatabase.db中找到数据库

      The Database could be found at Contents/MacOS/yourDatabase.db

      这篇关于错误地使用了当前的工作目录...我的数据库到底在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆