[sqlite-dev] SQLITE MAX FULL PATH OF DB ON LINUX

105 views
Skip to first unread message

Onur GURSOY

unread,
Oct 4, 2019, 3:33:50 PM10/4/19
to sqlit...@mailinglists.sqlite.org
Hello Everyone,

Nowadays i have problem with sqlite, I think problem is related to sqlite because , i use sqlite db browser or poco, after that i want to create or open db which is in following path. But it crashed. There is a limitation in sqlite ?

Note; length of full path of db is more than 504.
DB PATH: /tmp/pathTest/long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/longPath.db

--
Onur GÜRSOY
R&D Engineer in Embedded Systems
Master Student at Gebze Institute Of Technology
Department Of Electronic Engineering
GSM : 0(545) 764 7653
e-mail: onurgur...@gmail.com

stu...@aquarius-itech.com

unread,
Oct 4, 2019, 4:31:58 PM10/4/19
to sqlit...@mailinglists.sqlite.org

What platform?

I don’t know about Linux(Android, Apple, etc.) but to go that deep in Windows you need to either use relative paths that are less than 254 chars or use CreateFile with a path prepended with //?/.

I don’t know if sqlite uses windows CreateFile() to open databases but if it does it should accept //?/ if the string is passed through.

If it’s a third party app then there are other options.

In any OS you can create an alias (symbolic or hard link).

Mount the folder as a shorter path.

The first thing I would do is review the reasons for such a long path. In 30 years of system programming, I’ve never seen a reason for path that long or with white space, excepting WS in user folders. They have only ever caused trouble where I have encountered them.

Keith Medcalf

unread,
Oct 4, 2019, 10:52:01 PM10/4/19
to sqlit...@mailinglists.sqlite.org

In os_unix.c the maximum path length appears to be 512 bytes.

--
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.

>-----Original Message-----
>From: sqlite-dev <sqlite-de...@mailinglists.sqlite.org> On Behalf
>Of Onur GURSOY
>Sent: Friday, 4 October, 2019 13:34
>To: sqlit...@mailinglists.sqlite.org
>Subject: [sqlite-dev] SQLITE MAX FULL PATH OF DB ON LINUX
>

>e-mail: onurgur...@gmail.com <mailto:onurgur...@gmail.com>

_______________________________________________
sqlite-dev mailing list
sqlit...@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-dev

stu...@aquarius-itech.com

unread,
Oct 5, 2019, 6:24:36 AM10/5/19
to sqlit...@mailinglists.sqlite.org

I didn’t read the subject line so I missed the platform but the rest of the advice stands.

ing.conti

unread,
Oct 5, 2019, 7:00:10 AM10/5/19
to sqlit...@mailinglists.sqlite.org

On 5 Oct 2019, at 12:24, <stu...@aquarius-itech.com> <stu...@aquarius-itech.com> wrote:

I didn’t read the subject line so I missed the platform but the rest of the advice stands.
 
From: sqlite-dev [mailto:sqlite-de...@mailinglists.sqlite.org] On Behalf Of stu...@aquarius-itech.com
Sent: Friday, October 4, 2019 9:31 PM
To: sqlit...@mailinglists.sqlite.org
Subject: Re: [sqlite-dev] SQLITE MAX FULL PATH OF DB ON LINUX
 
What platform?
I don’t know about Linux(Android, Apple, etc.)


Why Apple?

Apple is NOT based in linux,  thanks to God :)

but to go that deep in Windows you need to either use relative paths that are less than 254 chars or use CreateFile with a path prepended with //?/.
I don’t know if sqlite uses windows CreateFile() to open databases but if it does it should accept //?/ if the string is passed through.
If it’s a third party app then there are other options.
In any OS you can create an alias (symbolic or hard link).
Mount the folder as a shorter path.
The first thing I would do is review the reasons for such a long path. In 30 years of system programming, I’ve never seen a reason for path that long or with white space, excepting WS in user folders. They have only ever caused trouble where I have encountered them.
 
 
From: sqlite-dev [mailto:sqlite-de...@mailinglists.sqlite.org] On Behalf Of Onur GURSOY
Sent: Friday, October 4, 2019 8:34 PM
To: sqlit...@mailinglists.sqlite.org
Subject: [sqlite-dev] SQLITE MAX FULL PATH OF DB ON LINUX
 
Hello Everyone,
 
Nowadays i have problem with sqlite, I think problem is related to sqlite because , i use sqlite db browser or poco, after that i want to create or open db which is in following path. But it crashed. There is a limitation in sqlite ?
 
Note; length of full path of db is more than 504.
DB PATH: /tmp/pathTest/long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/longPath.db

-- 
Onur GÜRSOY
R&D Engineer in Embedded Systems
Master Student at Gebze Institute Of Technology
Department Of Electronic Engineering
GSM : 0(545) 764 7653
e-mail: onurgur...@gmail.com
_______________________________________________
sqlite-dev mailing list
sqlit...@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-dev



ing. Conti G. Enrico
ingc...@ingconti.com
Ordine Ingegneri di Monza al n. A894 

PIVA 02119300966 
Cod Fatturazione: SUBM70N
 
via Andrea Doria, 9/A
20090 MONZA MI ITALY
0039-039-324723
www.ingconti.com




stu...@aquarius-itech.com

unread,
Oct 5, 2019, 12:13:37 PM10/5/19
to sqlit...@mailinglists.sqlite.org

The thought occurred to me that when you create or open a database, you create a journal which has the same name as the file with ‘journal’ appended to it. Probably the journal creation that failed at 504+journal+null.

You can get to 508 by using WAL mode but I think you’d need to create and switch to WAL on a shorter path first then move both files.

stu...@aquarius-itech.com

unread,
Oct 5, 2019, 12:24:06 PM10/5/19
to sqlit...@mailinglists.sqlite.org

It was late on Friday night. I meant *nix.

You’re right, of course. Apple started lifting FreeBSD a few years after M$. But let’s not get off topic.

ing.conti

unread,
Oct 5, 2019, 12:25:46 PM10/5/19
to sqlit...@mailinglists.sqlite.org

On 5 Oct 2019, at 18:23, <stu...@aquarius-itech.com> <stu...@aquarius-itech.com> wrote:

It was late on Friday night. I meant *nix. 
You’re right, of course. Apple started lifting FreeBSD a few years after M$. But let’s not get off topic.

Yes.
I f You need some specific tests on iOS / OSX I will be glad to test, Stuart.

:)

stu...@aquarius-itech.com

unread,
Oct 5, 2019, 3:51:29 PM10/5/19
to sqlit...@mailinglists.sqlite.org

Conti,

 

Thanks. I’ll keep it in mind.

Reply all
Reply to author
Forward
0 new messages