Updating perl

All filehandles are capable of read/write access, so you can read from and update any file or device associated with a filehandle.

updating perl-13updating perl-66

If you want to open a file for reading and writing, you can put a plus sign before the opens the file for appending, placing the file pointer at the end, so that you can immediately start appending information.

The seek function positions the file pointer to the specified number of bytes within a file − The function uses the fseek system function, and you have the same ability to position relative to three different points: the start, the end, and the current position. Zero sets the positioning relative to the start of the file.

For example, the line sets the file pointer to the 256th byte in the file.

However, you can't read from it unless you also place a plus sign in front of it − The sysopen function is similar to the main open function, except that it uses the system open() function, using the parameters supplied to it as the parameters for the system function − For example, to open a file for updating, emulating the You can use O_CREAT to create a new file and O_WRONLY- to open file in write only mode and O_RDONLY - to open file in read only mode.

The PERMS argument specifies the file permissions for the file specified, if it has to be created. Following is the table, which gives the possible values of MODE.

Leave a Reply