You are not logged in.

#1 2009-07-26 09:33:11

tadzik
Member
From: &tadzik
Registered: 2009-07-17
Posts: 91

[SOLVED] [Perl] Unable to read file

Hello,
Without much talking - this is the appropriate strace output, then my checks. The thing is: I can read file, perl cannot

open("~/.pacnet.db", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
write(2, "Could not open the package databa"..., 45Could not open the package database, exiting
) = 45
exit_group(2)                           = ?

[tadzik][~] $ file ~/.pacnet.db
/home/tadzik/.pacnet.db: ASCII C++ program text, with very long lines, with no line terminators

[tadzik][~] $ head -c 20 ~/.pacnet.db
[{"category__name": %                                                                                                                                                  

[tadzik][~] $ ls -l .pacnet.db 
-rw-r--r-- 1 tadzik tadzik 558167 07-26 11:08 .pacnet.db

The code is available here, line 58.
Any clues?
Regards
Ted

Last edited by tadzik (2009-07-26 10:06:05)

Offline

#2 2009-07-26 09:56:06

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: [SOLVED] [Perl] Unable to read file

Perl open() doesn't understand ~/... type paths.

Use glob() as shown here.

Last edited by mikesd (2009-07-26 10:01:02)

Offline

#3 2009-07-26 10:05:50

tadzik
Member
From: &tadzik
Registered: 2009-07-17
Posts: 91

Re: [SOLVED] [Perl] Unable to read file

glob() does its job in here. Thank You, kind sir.

Offline

Board footer

Powered by FluxBB