[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] Re: Lidt om midlertidige filer



On Sunday 04 December 2005 15:06, Adam Sjøgren wrote:
> > - Hvordan sikrer man sig at der ikke er andree programmer der bruger det
> > samme filnavn? Unde Windoze ville jeg bare bede om et GUID, som jeg så
> > bruger som filnavn, men hvad gør man under Linux?
>
> GUID (Windows) eller PID (Linux) er en dårlig idé ("fjenden" kan nemt
> finde dit filnavn) - kig i stedet på tmpfile(3).

OK, dette spørgsmål hører i princippet ikke til her, men jeg prøver alligevel. 
Jeg forstår ikke hvordan GUID kan være et problem under Windoze. GUID er ikke 
det samme som PID, GUID er en tal/bogstav-kombination der genereres af 
Windows på det tidspunkt, hvor du beder om den. Godt nok regner jeg med at 
man skal tage M$'s forsikring om at der aldrig vil blive genereret 2 ens 
GUID'er med et gran salt, men jeg tror ikke det er simpelt med vilje at 
generere det samme GUID, som et andet program. Er det dig eller mig der har 
overset noget?  :-)

Og så til det jeg egentlig ville skrive:

Tak for tippet, men nu skal jeg bruge filnavnet inde fra et bashscript (jeg 
skal bruge jpegtran til at rotere et billede, og jpegtran kan ikke bruge 
samme navn til input og output). Jeg kiggede på det der stod i See Also under 
tmpfile, og fandt dette eksempel under mktemp(1):

  TMPFILE=‘mktemp -t example.XXXXXXXXXX‘ || exit 1
  echo "program output" >> $TMPFILE

Det skal lige rettes til, så det virker under bash, men nu er jeg på rette 
vej.  :-)

-- 

        |\     _,,,---,,_       Greetings, Jens
 ZZZzz /,`.-'`'    -.  ;-;;,_
      |,4-  ) )-,_. ,\ (  `'-'  sslug@sslug
     '---''(_/--'  `-'\_)
----------------------------------------------------
A mathematician is a machine for converting coffee into theorems.

-- 

        |\     _,,,---,,_       Greetings, Jens
 ZZZzz /,`.-'`'    -.  ;-;;,_
      |,4-  ) )-,_. ,\ (  `'-'  sslug@sslug
     '---''(_/--'  `-'\_)
----------------------------------------------------
All men believe sex is better than chocolate. All women know chocolate is
better than sex. The only way to completely satisfy both sexes is to combine
the two.


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-01-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *