What are the pros & cons, if any, between using Perl's copy module vs OS's system cp, for copying a file to another directory? Or are they exactly the same?
1) Perl's File::Copy module, as in
2)
PS. Sorry if this is already discussed in other/older threads.
Thanks.
Last edited by Scott; 01-01-2010 at 01:32 PM..
Reason: Please use code tags
Hi,
- on a solaris box what is the best utility to copy a whole file system from one place to other? - the aim of the operation is to place the contents of
the whole file system to other file system within the discs
cp ? - cpio? - tar?
- what about file systemes containing symbolic links ?... (1 Reply)
Hi, i'm trying to make a system copy from one server to another (solaris 9), they have the same configuration. I've tried to create a flash archive using the flarcreate but the flash file size is 5.06 approx. and the method the flarcreate is using is CPIO and he cannot handle sizes over 4 GB.
Is... (2 Replies)
I am trying to write a script which has to copy the directory structure from my system to another system on the network. But I dont want the files to be copied.
I think I have to start with copying all subdirectories names in a directory to a system on the network.
Here's the case:
Source... (1 Reply)
Hi,
my router is my Linux embedded device.
I have system installed on HDD 4GB usb stick, part1 swap, part2 /opt , part3 data.
I need to copy my system to new HDD 8GB usb stick.
What is a way for 4GB > 4GB HDD
and what for 4GB > 8GB
As I remeber, I can copy image of my 4GB HDD usb stick... (7 Replies)
Hi
Could you please help me on this
I have folder called D:\Data in which we have 20 files coming daily and needed all 20 files to copy into D:\Target ,as i am new to PERL, i did nt know how to use this
I googled sme of the code and done the copy script,it is throwing error like we do... (1 Reply)
Dear Guy’s
By using dd command or any strong command, I’d like to copy huge data from file system to another file system
Sours File system: /sfsapp
File system has 250 GB of data
Target File system: /tgtapp
I’d like to copy all these files and directories from /sfsapp to /tgtapp as... (28 Replies)
Hi All,
I have successfully backup & restore (using tar) one of my Debian Lenny Servers.
On the restore server (standby machine), everytime i have to erase the disk & extract the tar backup.
I want to extract the tar on the running restore server on a directory for e.g /systembackup-01,... (11 Replies)
Hi
I have a shell script to copy a pattern of files from Linux to Windows Filesystem.
When i execute the below command
cp -av TOUT_05-02-13* Windows/Folder
`TOUT_05-02-13-19:02:37.tar.gz' -> `Windows/Folder/SYSOUT_05-02-13-19:02:37.tar.gz'
cp: cannot create regular file... (5 Replies)
Hello,
I am creating a new disk using the following command:
dd if=/dev/zero of=/export/home/ramdisk/0 bs=512 count=4096k
after creating the disk, i tool a ufsdump of a solaris 10 filesytem (disk size 512MB)
ufsdump -cvf /export/home/ufsdump/sol_orig /and then restored the dump files onto... (10 Replies)
Discussion started by: Zam_1234
10 Replies
LEARN ABOUT DEBIAN
file::type
File::Type(3pm) User Contributed Perl Documentation File::Type(3pm)NAME
File::Type - determine file type using magic
SYNOPSIS
my $ft = File::Type->new();
# read in data from file to $data, then
my $type_from_data = $ft->checktype_contents($data);
# alternatively, check file from disk
my $type_from_file = $ft->checktype_filename($file);
# convenient method for checking either a file or data
my $type_1 = $ft->mime_type($file);
my $type_2 = $ft->mime_type($data);
DESCRIPTION
File::Type uses magic numbers (typically at the start of a file) to determine the MIME type of that file.
File::Type can use either a filename, or file contents, to determine the type of a file.
METHODS
new
Returns a new File::Type object.
mime_type($argument)
Takes either data or a filename, determines what it is, and passes the argument through to the relevant method below. If the argument is a
directory, returns undef.
checktype_filename($filename)
Opens $filename (if possible; if not, returns undef) and returns the MIME type of the file.
checktype_contents($data)
Matches $data against the magic database criteria and returns the MIME type of the file.
TODO
* Add additional magic match criteria
BUGS
None known.
NOTES
Some magic definitions in the mime-magic file used in the creation of this module vary from those in other apps (eg image/x-png not
image/png).
SEE ALSO
File::MMagic and File::MimeInfo perform the same job, but have a number of problems that led to the creation of this module.
File::MMagic inlines a copy of the magic database, and uses a DATA filehandle, which causes problems when running under mod_perl.
File::MimeInfo uses an external magic file, and relies on file extensions rather than magic to determine the mime type.
As a result, File::Type uses a seperate module and script to create the code at the core of this module, which means that there is no need
to include a magic database at all, and that it is safe to run under mod_perl.
File::Type::Builder, which generates the code at the heart of this module.
ACKNOWLEDGMENTS
File::Type is built from a mime-magic file from cleancode.org. The original can be found at <http://clean-
code.org/cgi-bin/viewcvs.cgi/email/mime-magic.mime?rev=1.1.1.1>.
AUTHOR
Paul Mison <pmison@fotango.com>
COPYRIGHT
Copyright 2003-2004 Fotango Ltd.
LICENSE
Licensed under the same terms as Perl itself.
perl v5.8.8 2004-10-08 File::Type(3pm)