Deutsch   English   Français   Italiano  
<utqcru$l76t$1@dont-email.me>

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

Path: ...!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Malcolm McLean <malcolm.arthur.mclean@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: saving fileXXX.bmp
Date: Sun, 24 Mar 2024 23:26:53 +0000
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <utqcru$l76t$1@dont-email.me>
References: <utpl9q$2u0jk$1@i2pn2.org> <utq5qj$2ummn$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 25 Mar 2024 00:26:55 +0100
Injection-Info: dont-email.me; posting-host="89cda9b5b060c3bbdaaa3b408f28574f";
	logging-data="695517"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18vBuh5OWnb1qwtpCtSJfVsWQonBgvRVd0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:bgFwYmh4IPQ3MMmL4kI3suLCG6U=
In-Reply-To: <utq5qj$2ummn$1@i2pn2.org>
Content-Language: en-GB
Bytes: 2447

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.

-- 
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm