Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Check if File Exists

msiexpert created the topic: Check if File Exists
Using CreateInstall 4.

How can I check if a file exists at Program Folders\MySetup\Myprogram.exe?

applicationPackaging replied the topic: Re: Check if File Exists
For example,
you can use ‘Source Code’ command

macrox_setint( “mymacro”, fileexist( macrox_do(“#progfiles#\\MySetup\\Myprogram.exe”)))

After that you can use macro ‘mymacro’

Tagged :

How to Check File Attributes in Perl ? Perl File Attributes explained

perl-file-attributes

Checking File Attributes in Perl

I have been using perl for quite some time now. I have also been using the file handling logic in my scripts. However, what I did not know till now is that you can quickly check for certain file properties in perl. Here is an example:
#!/usr/bin/perl
my (@description,$size);
if (-e $file)
{
push @description, ‘binary’ if (-B _);
push @description, ‘a socket’ if (-S _);
push @description, ‘a text file’ if (-T _);
push @description, ‘a block special file’ if (-b _);
push @description, ‘a character special file’ if (-c _);
push @description, ‘a directory’ if (-d _);
push @description, ‘executable’ if (-x _);
push @description, (($size = -s _)) ? “$size bytes” : ‘empty’;
print “$file is “, join(‘, ‘,@description),”\n”;
}
Nice, isn’t it?
Here is the complete list of features that you can check:

Operator Description
-A Age of file (at script startup) in days since modification.
-B Is it a binary file?
-C Age of file (at script startup) in days since modification.
-M Age of file (at script startup) in days since modification.
-O Is the file owned by the real user ID?
-R Is the file readable by the real user ID or real group?
-S Is the file a socket?
-T Is it a text file?
-W Is the file writable by the real user ID or real group?
-X Is the file executable by the real user ID or real group?
-b Is it a block special file?
-c Is it a character special file?
-d Is the file a directory?
-e Does the file exist?
-f Is it a plain file?
-g Does the file have the setgid bit set?
-k Does the file have the sticky bit set?
-l Is the file a symbolic link?
-o Is the file owned by the effective user ID?
-p Is the file a named pipe?
-r Is the file readable by the effective user or group ID?
-s Returns the size of the file, zero size = empty file.
-t Is the filehandle opened by a TTY (terminal)?
-u Does the file have the setuid bit set?
-w Is the file writable by the effective user or group ID?
-x Is the file executable by the effective user or group ID?
-z Is the file size zero?
Tagged : / / / / / / / / / / / / / / /

How to read XML file by using shell script ?

read-xml-file-using-shell-script

This was like the first time where I had to write something that will be able to read something out of a XML file using a shell script. Usually I would use Python/Perl as my favorite choices in such a scenario but in this one I really *had* to do all within a shell script.

This is an example of the type of XML file I had to read:

Fixed a new bug
Shoaib Mir
Sun, 02 May 2010
shoaibmir[@]gmail.com

I ended up having a shell script like this:

#!/bin/bash

#Looking for four keywords in here
for key in changelog name date email
do
OUTPT=`grep $key log.xml | tr -d '\t' | sed 's/^\([^<].*\)$/\1/' `
eval ${key}=`echo -ne \""${OUTPT}"\"`
done

# Getting the results in four specific arrays
changelogarr=( `echo ${changelog}` )
namearr=( `echo ${name}` )
datearr=( `echo ${date}` )
emailarr=( `echo ${email}` )

#Print all Arrays
echo ${changelogarr[@]}
echo ${namearr[@]}
echo ${datearr[@]}
echo ${emailarr[@]}

Which gives me an output:

shoaib@shoaib-desktop:~/Desktop$ ./readxml.sh
Fixed a new bug Shoaib Mir
Sun, 02 May 2010
shoaibmir[@]gmail.com

 

Reference:

Reading XML file using shell script

 

Tagged : / / / / / / / / / / / / / / /

How To Create a Unique SRCSAFE.INI File ?

srcsafeini-file
1. Create a new SRCSAFE.INI file and place it in the desired location.
2. If you want include the default SRCSAFE.INI in the unique copy, add the following line:

#INCLUDE <SS path>\SRCSAFE.INI

3. Create the following environment variable:

SET SSDIR=<path to VSS directory>

(such as SET SSDIR = \\MyServer\MyVSSdir)

While it is possible to do this with Visual SourceSafe 5.0, in is not necessary. Simply open the database using file->open.

Tagged : / / / / / / / / / / / / / / /

File Comparing Tools Review and Feedback

file-comparing-tools-review

File Comparing Tools review
File comparison in computing is the automatic comparing of data between
files on a file system. The result of comparisons are typically
displayed to the user, but can also be used to accomplish tasks in
networks, file systems and revision control.| Comparison of file comparison tools | comparison tools | Good comparison tools | comparison tools review | comparison tools feedback | Free File comparison Tools || Beyond Compare Review | Compare Suite review | Araxis Merge review |ECMerg Review | FileMerge review | WinMerge Review | Diffutils Review|

 

Beyond Compare
Compare Files, Folders

Beyond Compare allows you to quickly and easily compare your files and folders. By using simple, powerful commands you can focus on the differences you’re interested in and ignore those you’re not. You can then merge the changes, synchronize your files, and generate reports for your records.

You can compare entire drives and folders at high speed, checking just sizes and modified times. Or, thoroughly verify every file with byte-by-byte comparisons. FTP sites and zip files are integrated seamlessly, so you can update your website with the touch of a button. Once you’ve found pecific files you’re interested in, Beyond Compare can intelligently pick the best way to compare and display them. Text files can be viewed and edited with syntax highlighting and comparison rules tweaked specifically for documents, source code, and HTML. Data files, executables, binary data, and images all have dedicated viewers as well, so you always have a clear view of the changes.

Specialized Viewers

Beyond Compare includes built-in comparison viewers for a variety of data types. Compare .csv data or HTML tables in a Data Compare session,
or images in a Picture Compare session.

3-way Merge Pro edition only

Introduced in version 3, Beyond Compare’s new merge view allows you to combine changes from two versions of a file into a single output. Its intelligent approach allows you to quickly accept most changes while carefully examining conflicts. Color coding and section highlighting allow you to accept, reject, or combine changes, simply and easily. And, you can change any line in the output with the built-in syntax-highlighting editor. By using Beyond Compare’s powerful file type support and ability to favor changes from one file, you can trivially accept many changes without even seeing them.

You can use Beyond Compare directly from most version control systems, giving you all of the powerful comparing and merging support you need when you need it most. Integrated source control commands are also available, allowing you to check in and check out files without interrupting your work.

Synchronize Folders

Beyond Compare’s intuitive Folder Sync interface lets you reconcile differences in your data automatically. You can efficiently update your laptop, backup your computer, or manage your website, and Beyond Compare will handle all the details. You can copy to and from disks, FTP servers, and zip files, all using the same interface. Anything you don’t want affected can be easily filtered out, and all of the powerful comparison techniques are available, making the backup as fast or robust as you need.

You can automate repetitive tasks using a flexible scripting language, and any script can be called from the command line, allowing you to schedule your syncs for when it’s most convenient.

 

Compare Suite
By keywords comparison allows to match non-related documents with different structure.

Compare two folders feature allows to find and synchronize changes that were made in two folders.

Report can be created once you compared two files or folders. It contains detailed comparison information.

Document audit allows to accept or decline changes that were made in plain text files .

Ignore words. Starting version 5.0 Compare Suite can ignore certain keywords or strings while comparison.

Syntax highlighting. Compare Suite can now highlight syntax for some popular formats, such as .pas, .php, .htm and other.

Multimedia and graphics comparison. Compare Suite can compare information from multimedia and graphic formats.

Command line allows to automate comparison and integrate Compare Suite with other software products, Compare Suite can be a part of quality assurance script set.

Server-side comparison. Provide your employees with ability to compare documents on-line.

 

Araxis Merge
  • File comparison and merging
  • Binary and image file comparison
  • Three-way comparison and automatic merging
  • Integrated folder hierarchy comparison and synchronization
  • Direct access to FTP sites and configuration management systems
  • Report generation
  • Print support, Automation and other advanced features
ECMerge
ECMergePro 2.0 is a powerful comparison and merge software. ECMerge
provides for side-by-side, two- and three-way file revision and folder
synchronization. ECMergePro 2.0 is available in three versions: MS
Windows, Linux and Solaris. In MS Windows, ECMergePro 2.0 can be
integrated in Windows explorer. The software also provides for command
line support.

  • File comparison
  • Folder comparison
  • Image Comparison
  • Reports
  • File conversion: supported
  • Diverse comparison methods
  • Three-way comparison Yes
  • Text navigation
  • Report functionality
  • Merge functionality
  • Integration with version control systems Yes
  • Folder comparison
  • Folder hierarchy synchronization Yes
  • Custom file filters
  • Byte-by-byte comparison
FileMerge
FileMerge is one of the old NeXT Developer applications that survived into the days of Mac OS X, and with good reason: It kicks the pants off anything else when it comes to quickly going through file changes, marking them on the scrollba, allowing you to breeze through them with parallax scrolling, and merging them with a single click:
WinMerge
WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.

WinMerge is highly useful for determining what has changed between project versions, and then merging changes between versions. WinMerge can be used as an external differencing/merging tool or as a standalone application.

Features

In addition, WinMerge has many helpful supporting features that make comparing, synchronising, and merging as easy and useful as possible:

General

  • Supports Microsoft Windows 98/2000/XP/2003/Vista/2008
  • Handles Windows, Unix and Mac text file formats
  • Unicode support
  • Tabbed interface

File Compare

  • Visual differencing and merging of text files
  • Flexible editor with syntax highlighting, line numbers and
  • word-wrap
  • Highlights differences inside lines
  • Difference pane shows current difference in two vertical

Panes

  • Location pane shows map of files compared
  • Moved lines detection

Folder Compare

  • Regular Expression based file filters allow excluding and
  • including items
  • Fast compare using file sizes and dates
  • Compares one folder or includes all subfolders

Version Control

  • Creates patch files
  • Resolve conflict files
  • Rudimentary Visual SourceSafe and Rational ClearCase integration

Other

  • Shell Integration (supports 64-bit Windows versions)
  • Archive file support using 7-Zip
  • Plugin support
  • Localizable interface
  • Online manual and installed HTML Help manual
Diffutils
You can use the diff command to show differences between two files, or each corresponding file in two directories. diff outputs differences between files line by line in any of several formats, selectable by command line options. This set of differences is often called a `diff’ or `patch’. For files that are identical, diff normally produces no output; for binary (non-text) files, diff normally reports only that they are different.

You can use the cmp command to show the offsets and line numbers where two files differ. cmp can also show all the characters that differ between the two files, side by side.

You can use the diff3 command to show differences among three files. When two people have made independent changes to a common original, diff3 can report the differences between the original and the two changed versions, and can produce a merged file that contains both persons’ changes together with warnings about conflicts.

You can use the sdiff command to merge two files interactively.

Tagged : / / / / / / / / / / / / / / / / / / / / / / / / /