Re: use fopen unknown resource

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: ourdiaspora <ourdiaspora(at)protonmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: use fopen unknown resource
Date: 2021-08-28 22:35:20
Message-ID: 246d107b-b4be-6290-fe32-95697acbfb05@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/28/21 2:55 PM, ourdiaspora wrote:
>
> On Saturday, August 28th, 2021 at 5:52 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>
>>
>> You are asking the user to select a file, so there should be some sort
>>
>> of file reference at that point, correct?
>>
>
> This is what causes confusion. If a user has a file named 'mydatafile.csv', why does the manual make reference to open 'test.csv'???:

Because that is a 'dummy' file name for the purposes of illustrating
what sort of information needs to be provided. Just substitute in
whatever file name is actually being fetched in the production code.

>
> https://www.php.net/manual/en/function.fgetcsv.php
> "
> ...
> if (($handle = fopen("test.csv", "r")) !== FALSE) {
> ...
> "
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Trang Le 2021-08-29 03:40:46 Insert statement doesn't complete
Previous Message Tom Lane 2021-08-28 22:26:21 Re: Can we get rid of repeated queries from pg_dump?