Link to home
Start Free TrialLog in
Avatar of jl66
jl66Flag for United States of America

asked on

how to empty a file with DOS shell or Perl

In Unix, empty a file with
touch file.txt
or
> file.txt
In DOS or Perl, is anything similar I can use? For example,
07/04/2009  06:20 PM             2,945 file.txt
Want it to be
07/04/2009  06:22 PM             0 file.txt
SOLUTION
Avatar of ghostdog74
ghostdog74

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The traditional DOS way is
copy nul file.txt

No error, no contents.