Perl [RESOLVED] Problem with creating file
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: [RESOLVED] Problem with creating file

  1. #1
    Join Date
    Jun 1999
    Posts
    488

    [RESOLVED] Problem with creating file

    Hi,
    I am trying to create a file but its not working. No file is created.
    Code:
    #!C:/Perl64/bin/perl.exe
    my $existringdir = 'dir1';
    mkdir $existringdir unless -d $existingdir; # Check if dir exists. If not create it.
    
    
    open (MYFILE, '<$existringdir/data.txt');
    print MYFILE "Bob\n";
     close (MYFILE);
    The running process is shown below
    D:\Zulfi\PERL MAIN FOLDER>perl file1.pl

    D:\Zulfi\PERL MAIN FOLDER>dir dir1
    Volume in drive D has no label.
    Volume Serial Number is 8E4F-05BE

    Directory of D:\Zulfi\PERL MAIN FOLDER\dir1

    11/09/2013 12:53 PM <DIR> .
    11/09/2013 12:53 PM <DIR> ..
    11/09/2013 12:59 PM 0 file.txt
    1 File(s) 0 bytes
    2 Dir(s) 524,336,050,176 bytes free

    D:\Zulfi\PERL MAIN FOLDER>type file1.pl
    #!C:/Perl64/bin/perl.exe
    my $existringdir = 'dir1';
    mkdir $existringdir unless -d $existingdir; # Check if dir exists. If not create
    it.


    open (MYFILE, '<$existringdir/data.txt');
    print MYFILE "Bob\n";
    close (MYFILE);

    D:\Zulfi\PERL MAIN FOLDER>
    Plz guide me.

    Zulfi.

  2. #2
    Join Date
    Jun 1999
    Posts
    488

    Re: Problem with creating file

    Hi,
    This problem is solved now.

    http://forums.about.com/n/pfx/forum....-perl&tid=1440

    Zulfi.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center