Re: saving fileXXX.bmp

Liste des GroupesRevenir à l c 
Sujet : Re: saving fileXXX.bmp
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.c
Date : 25. Mar 2024, 20:44:34
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <utsgmp$31pg0$1@i2pn2.org>
References : 1 2 3 4
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
Mike Terry wrote:
On 25/03/2024 08:07, fir wrote:
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
>
What you're describing is the standard windows way /for the user to
identify a file/ e.g. an application document that the user has created
and wants to save /somewhere they specify/.
>
It's not the the standard windows way to create a temporary file for
application use.  For that purpose I imagine the "standard" process
would be to call GetTempPath() then possibly create a subfolder for your
application, and save the file there.  "Standard" apps like Visual
Studio, Office etc. all create temp files without prompting the user
with a dialog box.
>
Mike.
>
i dont want temp file so i dont fully know what you are talkin about
i just want a quicksave say you draw image and after say 30 seconds of editions you pred F5 for quicksave and you got a history of editions in a form of many bitmaps in working directory - then you can delect them and delete those not needed with total commander

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