A Travel and vacations forum. TravelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » TravelBanter forum » Travelling Style » Air travel
Site Map Home Authors List Search Today's Posts Mark Forums Read Web Partners

life after Windows....



 
 
Thread Tools Display Modes
  #1  
Old April 3rd, 2009, 12:53 PM posted to uk.politics.misc,rec.travel.europe,rec.travel.air,rec.photo.digital
Keith Willshaw[_4_]
external usenet poster
 
Posts: 121
Default life after Windows....


"Mxsmanic" wrote in message
...
Keith Willshaw writes:

It looks in the registry oh dim one


How will the registry tell the OS the purpose of a file being created by
an
application?


Typical entry

HKEY_CLASSES_ROOT\.docx
Key Name Value
Default Word.Document.12
Content Type
application/vnd.openxmlformats-officedocument.wordprocessingml.document


What about operating systems with no registry?


They typically have similar mechanisms, thats how they know to open
Word if you double click on a .doc file


No wonder you couldnt hold down a job in IT

Keith



  #2  
Old April 3rd, 2009, 06:18 PM posted to uk.politics.misc,rec.travel.europe,rec.travel.air,rec.photo.digital
Mxsmanic
external usenet poster
 
Posts: 5,830
Default life after Windows....

Keith Willshaw writes:

Typical entry

HKEY_CLASSES_ROOT\.docx
Key Name Value
Default Word.Document.12
Content Type
application/vnd.openxmlformats-officedocument.wordprocessingml.document


So?

The program calls the API with a request to create file c:\data\xyz.abc. How
does the OS determine the purpose of this file, and how does it know whether
or not the file is being created in the "right" place?
  #3  
Old April 3rd, 2009, 09:48 PM posted to uk.politics.misc,rec.travel.europe,rec.travel.air,rec.photo.digital
Keith Willshaw[_4_]
external usenet poster
 
Posts: 121
Default life after Windows....


"Mxsmanic" wrote in message
...
Keith Willshaw writes:

Typical entry

HKEY_CLASSES_ROOT\.docx
Key Name Value
Default Word.Document.12
Content Type
application/vnd.openxmlformats-officedocument.wordprocessingml.document


So?

The program calls the API with a request to create file c:\data\xyz.abc.
How
does the OS determine the purpose of this file, and how does it know
whether
or not the file is being created in the "right" place?


The OS neither knows nor cares, all that matters is that the action
is legal. That is to say the file name is of the right format for the
OS and that the location being accessed 1) exists and 2) the calling
procedure has the correct access rights.

The base tier of the calling program on the other hand should have rules
implemented
that ensure that the correct extension is appended to the file and that the
correct write opertation is carried out, sequential , text , binary etc.

If the file location is critical then the rules that govern that should be
implemented
in the middle tier. If that decision requires human intervention this is
passed to
the top or presentation tier.

This is software design 101 by the way.

Keith


  #4  
Old April 3rd, 2009, 10:32 PM posted to uk.politics.misc,rec.travel.europe,rec.travel.air,rec.photo.digital
Mxsmanic
external usenet poster
 
Posts: 5,830
Default life after Windows....

Keith Willshaw writes:

The OS neither knows nor cares, all that matters is that the action
is legal.


Right. Which makes it possible for applications to misuse even the best APIs.
QED.
  #5  
Old April 4th, 2009, 12:30 AM posted to uk.politics.misc,rec.travel.europe,rec.travel.air,rec.photo.digital
Keith Willshaw[_4_]
external usenet poster
 
Posts: 121
Default life after Windows....


"Mxsmanic" wrote in message
...
Keith Willshaw writes:

The OS neither knows nor cares, all that matters is that the action
is legal.


Right. Which makes it possible for applications to misuse even the best
APIs.
QED.


The question you put was

If a program creates a file, how does the API check to see that the file's
name is correct?


Now API's are NOT only implemented at the OS level but I dont expect a
tour guide to know that. In the context of the OS API the posit that the
name
is 'correct' simply means legal etc.

As an example the Windows WriteFile Api takes the following arguments

BOOL WriteFile(
HANDLE hFile, // handle to file to write to
LPCVOID lpBuffer, // pointer to data to write to file
DWORD nNumberOfBytesToWrite, // number of bytes to write
LPDWORD lpNumberOfBytesWritten, // pointer to number of bytes written
LPOVERLAPPED lpOverlapped // pointer to structure needed for overlapped
I/O
);It returns False if the operation fails , because of an illegal name for
example.
The details of the error may be retrieved by a GetLastError call.

On the other hand the API's I call at the application level have much
more specific error checking. If I attempt to open a jpeg filewith an API
it reads the file header to check its a valid format.

Keith


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
life after Windows....Users have until 14 April 2014 to migratefrom Windows XP. Shawn The Sheep Air travel 1 April 3rd, 2009 03:28 PM
life after Windows.... Mxsmanic Air travel 56 March 30th, 2009 12:49 PM
life after Windows.... White Spirit[_2_] Air travel 7 March 28th, 2009 08:29 AM
life after Windows.... Mxsmanic Air travel 0 March 27th, 2009 05:50 PM
life after Windows.... Doug Jewell Air travel 0 March 27th, 2009 09:09 AM


All times are GMT +1. The time now is 01:24 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 TravelBanter.
The comments are property of their posters.