Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: why does open ">..." sometimes touches the directory?

by vinoth.ree (Parson)
on Feb 05, 2013 at 08:42 UTC ( #1017084=note: print w/ replies, xml ) Need Help??


in reply to why does open ">..." sometimes touches the directory?

In Linux '>' redirect symbol is used to create new file, if the file exists it removes the existing content and creates new file.

Use Three-argument open(), to open a file its safer open my $fh, '>', $filename or die "Can't write to '$filename': $!\n"; Update:

Shorthand Flags:

Entities Definition
< or r Read Only Access
> or w Creates, Writes, and Truncates
>> or a Writes, Appends, and Creates
+< or r+ Reads and Writes
+> or w+ Reads, Writes, Creates, and Truncates
+>> or a+ Reads, Writes, Appends, and Creates


Comment on Re: why does open ">..." sometimes touches the directory?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017084]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2014-10-02 01:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (41 votes), past polls