Subscribe by Email


Showing posts with label Read. Show all posts
Showing posts with label Read. Show all posts

Sunday, June 23, 2013

Explain the various File Operations

A number of operations can be carried out on a file. However, there are 6 basic file operations. As we know a file is an ADT or abstract data type. Certain operations need to be considered for defining a file. Operating systems makes calls to these operations. 

Following are the six basic operations:

1. Creation of a file: 
- This operation involves two steps. 
- Firstly, a sufficient space has to be found for storing the file in the file system. - Secondly, for this new file an entry should be made in the directory.

2. Writing to a file: 
- For writing data to a file, a system call has to be made with name and the data to be written as its arguments. 
- A writer pointer is kept by the system at the location in the file where the next write operation is to be carried out. 
- This pointer is updated whenever a write operation occurs.

3. Reading from a file: 
- Just like the write operation, in order to read information from a file, a system call has to be generated along with the name of the file and the location of the content to be read as its arguments. 
- Here, instead of a write pointer there is a read pointer that will indicate the location where the next read operation is to take place. 
- The location at which the current operation is being carried out is kept as a “per – process current – file – position” pointer since the process is either writing to or reading from the file. 
- The same pointer can be used by both the read and write operations in order to reduce the complexity of the system as well as for saving space.

4. Re-positioning within a file: 
- System carries out search in the directory looking for the appropriate entry. 
When found, the current file position pointer is re-pointed to this position. 
This file operation does not require carrying out any input or output operation in actual. 
- Another name for this file operation is the file seek.

5. Deletion of a file: 
- For deletion of the file, the system searches through the directory to find the appropriate entry. 
- When found, the space held by this file is released and the entry in the directory is destroyed so that this space can be reused by other files.  

6. Truncating a file: 
- Sometimes you may require deleting only the contents of a file while keeping it attributes. 
- Deleting the file and recreating it is not an efficient solution. 
- This file operation lets you to erase the contents of the file but save its attributes.
- But here the length attribute of the file will be changed to zero after truncation. 
- The file space is released after truncating.


The above mentioned six basic file operations constitute the minimal file operations set. These operations are primary ones and if combined can perform some other secondary file operations such as copying. A table known as the open file table is maintained by the operating system that stores all the information about the files that are currently open. When the file is closed, its entry is deleted from the open file table. Some files have to be opened explicitly with the function open() before using it. The name of the file is passed as an argument to this function. Then it looks in the directory for this file and an entry is made in the open file table.  Each file has some access rights. It is in these access modes that a process uses the file. A process can perform only those operations which are permitted by the access rights of the file. 


Tuesday, April 30, 2013

What is hard disk and what is its purpose?


- HDD or Hard Disk Drive is for data storage. 
- It is used for storage and retrieval of the digital information or data that is stored on it. 
- The data is stored or retrieved by means of its discs that rotate rapidly. 

Hard Disk and its Purpose

 
- These discs are known as the platters and are coated with some sort of magnetic material. 
- The major characteristic as well as benefit of hard disk drives is that they retain the data even when the power supply is switched off. 
- From hard disk, the data can be read in a manner of random access. 
- This means that the storing and retrieval of the individual blocks of the data can be done either sequentially or in any order that the user may like. 
- A hard disk may consist of one or more than one of those rigid platters. 
These rotating discs have magnetic heads that are located on an actuator arm that is continuously moving and reads and writes data on their surfaces. 
IBM was the first to introduce the hard disk in the year of 1956. 
- Hard disk drives are the most dominant and the prominent secondary storage device for the computers since 1960s. 
- Since then, it has been continuously improved. 
- The HDD units are produced by more than 200 companies; among them most prominent developers are Toshiba, Seagate, Western digital etc. 

HDD’s primary characteristics are:
Ø  Capacity and
Ø  Performance
- The former is specified in terms of the unit prefixes. 
- In some systems, the capacity of the hard disk drive might be unavailable to the user since being used by the operating system and the file system and may have a possibility of occurrence of redundancy.
- The latter is specified in terms of the movements of the heads for a file i.e., the average access time in addition to the time taken for moving the file under the head i.e., the average latency and data rate. 

HDDs are available in two most common factors namely:
Ø  3.5 inch for desktop computers
Ø  2.5 inch for laptops

HDDs might be connected to the system by any of the following standard interface cables:
Ø  Serial ATA or SATA cable
Ø  USB cable
Ø  Serial attached SCSI or SAS cable

- In the year of 2012, flash memory emerged as a tough primary competitor for the hard disk drives. 
- These flash memories are some sort of solid state drives or SSDs. 
- However, the HDDs will still continue to dominate the secondary storage for its advantages such as price per unit of storage and recording capacity. 

- But there is a different scenario is the case of portable electronics.
- Here, the flash drives are considered to be more useful then rotating HDDs because here the durability and physical size of the drive has also to be considered more when compared to price and capacity.
HDD uses the magnetic recording technology where the data is recorded by magnetizing a thin film of material that is typically ferromagnetic on a disk. 
The binary data bits are represented by the sequential change in the direction of the magnetization.
- An encoding scheme is used for encoding the user data. 
- An example of such encoding scheme run – length limited encoding. 
It is these schemes that determine how the magnetic transitions would represent the data.

The latest HDD technologies are:
Ø  Shingled write
Ø  CPP/ MGR heads
Ø  Heat assisted magnetic recording
Ø  Bit – patterned recording


Tuesday, September 25, 2012

What is the difference between functions and actions in QTP?


Functions and actions are two different aspects of quick test professional. In this article we will talk regarding the two and see what the differences between them are. 

What are functions in QTP?

- In most of the cases you may need to use some segments of code again and again in your tests. 
- In such a case a user defined function can be created which will not only reduce the length of your tests but will also make it easier to be designed, read and maintained. 
- The created functions can consist of the following:
  1. Sub routines,
  2. Modules
  3. VBScript functions and so on.
- Three simple tests need to be followed if a function is to be used in the test from a library:
  1. For creating a new function you can select new function library from the file menu. This cause a new tab to open up in the quick test professional window. You can even opt for multiple tests in the same file.
  2. Next you need to save the function with extension “.qfl” and associate the appropriate library with that particular function. “Associate function library” option can be accessed from file menu.
  3. Now the third step is to invoke the function using the usual simple function call. Quite advanced or sophisticated functions can be generated using DCOM and COM.

What are actions in QTP?

- Whenever you have a piece of code at your disposal you get two options in quick test professional i.e., to either turn it in to a function or a reusable action.
- When the quick test 9 was introduced by the mercury, an argument was made in the favor of the functions for making them more compelling by the means of multi document interface. 
- Many function libraries can be used at once but still mostly one test is used. 
- If you want a reusable action to be edited, the current test has to be shut down. 
- Then you need to open the test in which you want to make the changes, make the changes and then save and close. 
- Later, the original test can be re-opened.

Differences between Functions and Actions in QTP

Now we are stating below some very basic differences between the functions and actions in quick test professional:

1. Passing of Data: 
Functions can access a variety of objects advance as well as primitive like arrays, test objects (such as frames, pages and so on.) and dictionary objects. But this is not the case with the actions rather they can accept only primitive kind of data types such as parameters like integers, strings and so on.

2. Use of Resources: 
Each action is provided with the following basic things:
a)   A folder
b)   3 separate VBS files
c)   A subfolder for keeping snapshots
d)   A certain amount of load time
e)   An excel spreadsheet and
f)    A local object repository.
On the other hand a function consists of only the code and nothing else.

3. API: 
For functions, the function libraries can be attached to the test scripts through the API of the quick test professional. As for the actions the insertion of the calls in the existing actions is not possible through the API of the quick test professional rather it can be done only through the interface.

4. Return Values: 
Actions return the values which are quite difficult to be read in syntax as well as understand. On the other hand the return values of the functions work well and similarly in all the languages.
With actions your test can be divided in to business processes or logical units along with the scripts that are more efficient as well as modular.


Wednesday, September 12, 2012

How will you call from one action to another action in QTP?


In the test scripts produced with the help of quick test professional, one action can be called from another action. In this article we are going to discuss the same i.e., how this can be done? 

How to call from one action to another action?

- A call to a reusable action can be inserted easily that might be stored in some local test (current test) or in some external test (external test). 
- Calling one action from some other action is just like inserting an action call in an existing action or just linking it to it.
- The steps involved in this whole process can be viewed using the action view tool but they cannot be modified. 
- The local object repository of the action that has been called is read only. 
- It is not necessary that each and every calling and called action must have a local object repository. 
- It may or may not have a repository.
- If the external action that has been called has some data in the data table, you get two options:
  1. Either you take the data from the data sheet of the action and import it as a editable or local copy,
  2. Or you take the data from the original action but here the data is read only type.
- The data obtained from the global data sheet of the action that has been called is imported to the test as an editable and local copy of data.
- In order to modify an existing external action you need to open the particular test where you have the action stored and make modifications there itself. 
These modifications will be visible in all the tests that will call that particular function. 
- If you choose to go for the second option as mentioned above then the changes that you will make will apply to original data as well. 

Step by step procedure of how a call to an action can be inserted?

  1. Go to insert menu, the select the “call to existing action” option and you will be provided with a list of actions. From that select “insert call to existing action” or you can also right click on any of the steps. The go for the action button and then click on “insert call to existing” option. Now a action properties dialog box pops up.
  2. There is a browse button called “from test” and can be used to find the test that holds the action to be called. All the reusable actions in the test that you select are displayed in this action box.
  3. From the action that is displayed select the action that is to be called and its type as well as description both are displayed if available. This type and description help you further in proper identification of the action that you wish to be called.  You can even set other properties of the actions by going to the “setting general action properties”.
  4. Now you are done with setting the properties, decide on where the function has to be inserted. For inserting the function you are provided with two options namely:
a)   After the current step or
b)   At the end of the test
There is one thing to be noted which is that if the step that is in current selection is a reusable action from some another test, then the action call is added at the end of the test automatically.
  1. Now the last step is to just clock on the OK button and you have your action inserted. This action can be moved to any other desired location by just dragging it to that position.


Thursday, December 17, 2009

CPU Caching

The cache on your CPU has become a very important part of today's computing. The cache is a very high speed and very expensive piece of memory, which is used to speed up the memory retrieval process. Without the cache memory every time the CPU requested data it would send a request to the main memory which would then be sent back across the memory bus to the CPU. This is a slow process in computing terms. The idea of the cache is that this extremely fast memory would store and data that is frequently accessed and also if possible the data that is around it.

CPU's however use a 2 level cache system. The level 1 cache is the fastest and smallest memory, level 2 cache is larger and slightly slower but still smaller and faster than the main memory. The main problem with having too much cache memory is that the CPU will always check the cache memory before the main system memory.

Read cache is used to store copies of data and instructions that are retrieved from main memory or mass storage. If the central processing unit (CPU) needs to access the same data or instructions again, it can use the copy in read cache. This is much faster the going back to main memory or mass storage again. Write cache is a temporary store for data that needs to be written to main memory or mass storage. The CPU can move the data into cache very quickly, and then continue executing instructions. The data is subsequently moved to its permanent location by the cache controller, a process that takes more time because main memory and mass storage devices are much slower to access than cache memory.


Facebook activity