Re: saving fileXXX.bmp

Liste des GroupesRevenir à cl c  
Sujet : Re: saving fileXXX.bmp
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.c
Date : 25. Mar 2024, 10:07:01
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <utrbbd$30267$1@i2pn2.org>
References : 1 2
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
Mike Terry wrote:
On 24/03/2024 16:44, 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)
>
I think the bigger issue is where to create such files?  If users have
used your app to open some existing .bmp file for processing, it's quite
possible they won't have write access to that folder. In that case a
Save or Save As operation should trigger a standard file system file
select dialog in a GUI program which is fair enough, but it sounds like
you want to create a temp file with no user intervention?  Command line
utilities often have some kind of "temp folder" option.
>
Ideas to consider:
-  tmpfile()  (POSIX?]
-  GetTempFileName(), GetTempPath() [Windows]
-  Use environment variables like TMP/TEMP?  (Possibly different usage
on different platforms)
-  how to clean up such temp files so they don't pollute the file system
long term?
-  ensuring uniqueness?  [e.g. if multiple copies of your program are
running at the same time]
    (Your idea is ok on this front, provided:
    *  only one process can create the temp file and
    *  a second open attempt with the same name will fail, and
    *  your logic has a loop to recognise such failures and try again
with a
       new name etc..
    Note GetTempFileName() fails on this front...)
-  Other filename ideas : including timestamps or GUIDs or PIDs in the
filename, but by
    themselves those may not fully solve uniqueness problem.
-  Listing the directory to generate available filenames might be more
    efficient in some usage cases, especially if the API includes file
filter options.
>
the issue is that standard windows ways to do it - like chose tool form menu then use it, save file bny opening save dialogs - are terribly slow if someone want to do things wuick and fast - thats why i like the
programs like irfanview or total commander for example
here i just want to save current edited image state like by pressing F5
like quicksave in doom game or something and load it by pressing say F8
or something
i would like to save in app directory which probably the application has right to write...its editor for my use mainly if not exclusively
i want to do a lot of things by keystrokes keyholds and mouse not
by menu etc ..i know such programs are hard to learn and this the
scope of people using them gets down but in turn are quick to do things if you learn them
hovever i dropped the idea to rapidly code this (becouse other occupations) but the problem of saving this is somewhat worth to learn

Date Sujet#  Auteur
24 Mar 24 * saving fileXXX.bmp24fir
24 Mar 24 +* Re: saving fileXXX.bmp2Malcolm McLean
25 Mar 24 i`- Re: saving fileXXX.bmp1Mikko
24 Mar 24 +* Re: saving fileXXX.bmp14fir
24 Mar 24 i+* Re: saving fileXXX.bmp10jak
25 Mar 24 ii`* Re: saving fileXXX.bmp9fir
25 Mar 24 ii `* Re: saving fileXXX.bmp8jak
26 Mar 24 ii  `* Re: saving fileXXX.bmp7fir
26 Mar 24 ii   `* Re: saving fileXXX.bmp6fir
26 Mar 24 ii    `* Re: saving fileXXX.bmp5jak
27 Mar 24 ii     `* Re: saving fileXXX.bmp4fir
27 Mar 24 ii      `* Re: saving fileXXX.bmp3jak
27 Mar 24 ii       `* Re: saving fileXXX.bmp2fir
28 Mar 24 ii        `- Re: saving fileXXX.bmp1jak
25 Mar 24 i`* Re: saving fileXXX.bmp3Malcolm McLean
25 Mar 24 i `* Re: saving fileXXX.bmp2fir
25 Mar 24 i  `- Re: saving fileXXX.bmp1fir
25 Mar 24 `* Re: saving fileXXX.bmp7Mike Terry
25 Mar 24  `* Re: saving fileXXX.bmp6fir
25 Mar 24   `* Re: saving fileXXX.bmp5fir
26 Mar 24    +* Re: saving fileXXX.bmp3fir
26 Mar 24    i`* Re: saving fileXXX.bmp2fir
26 Mar 24    i `- Re: saving fileXXX.bmp1fir
28 Mar 24    `- Re: saving fileXXX.bmp1fir

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal