Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <utrbg2$30267$2@i2pn2.org>
Deutsch   English   Français   Italiano  
<utrbg2$30267$2@i2pn2.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder6.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: fir <fir@grunge.pl>
Newsgroups: comp.lang.c
Subject: Re: saving fileXXX.bmp
Date: Mon, 25 Mar 2024 09:09:33 +0100
Organization: i2pn2 (i2pn.org)
Message-ID: <utrbg2$30267$2@i2pn2.org>
References: <utpl9q$2u0jk$1@i2pn2.org> <utq5qj$2ummn$1@i2pn2.org> <utqcru$l76t$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 25 Mar 2024 08:09:39 -0000 (UTC)
Injection-Info: i2pn2.org;
	logging-data="3147975"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="+ydHcGjgSeBt3Wz3WTfKefUptpAWaXduqfw5xdfsuS0";
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
X-Spam-Checker-Version: SpamAssassin 4.0.0
In-Reply-To: <utqcru$l76t$1@dont-email.me>
Bytes: 2689
Lines: 40

Malcolm McLean wrote:
> On 24/03/2024 21:26, fir wrote:
>> fir wrote:
>>> i want to save bitmap (when using editor) but i dont wannt
>>> to pen a dialog for saving ui just wana do quicksave but not replace
>>> the file already exist so i want to maybe use such scheme i will sawe
>>>
>>> "painting001.bmp" and if there is such number i will just increase
>>> the number to 002 if such exist i will use 003 and so on
>>>
>>> do yu thing it is standable to use c std lib (and probably just
>>> fopen fclose to detect if that file already exist of there is a need
>>> to use some specific windows functions?
>>>
>>> i never used it though - though maybe i could becouse code
>>> that is able to walk on directories and read all files may be handy
>>> for various practical usage (liek finding something , removing
>>> duplicates etc)
>>
>> the question is if if somoene would work longer and had 1000 bitmaps
>> in folder if this will not slow down, or still be fast etc...could check
>> experimentally but even then i wouldnt be sure if this is kinda
>> optimal or wastefull way
>
> Opening a file is rather a slow operation. But not so slow on most
> platforms. Of course there will come a point where the approach is
> simply too slow. But for saving human-generated bitmaps I don't think
> you'll test the limits.
>

but if you open 1000th ypu need to try-open 999 which im not sure is
okay or not ...im not sure if this opening is like read a directory data 
  and localise this name in it or it is more heavy and also involves
something heavier

for safety it rather means i should possibly read on api to read 
directory files list better (which probably is also easy as i may just 
google it)

but i will see yet