Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5972325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:38:31+00:00 2026-05-22T20:38:31+00:00

I have the following sequence of code: $fp = fopen(‘script.sh’, ‘wt’); fwrite($fp, ‘some text’);

  • 0

I have the following sequence of code:

$fp = fopen('script.sh', 'wt');
fwrite($fp, 'some text');
fclose($fp);

Now this should write some text to script.sh, simple and clear and worked for a while. But since yesterday script.sh is always empty, even though some text is not empty at all. The funny part is that no errors are returned. Also if I type manually something inside script.sh and then run the code script.sh is empty again.

Permissions are 777. The file is correct (if I delete it it says that the file does not exist).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:38:31+00:00Added an answer on May 22, 2026 at 8:38 pm

    There is no FOPEN mode ‘wt’ so it will default to WRITE as defined in the PHP doc:

    Open for writing only; place the file
    pointer at the beginning of the file
    and truncate the file to zero length.
    If the file does not exist, attempt to
    create it.

    http://uk.php.net/manual/en/function.fopen.php

    Open the file with either APPEND (a) or WRITE (w) mode in order to write data to the file correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following XSD code: <xsd:complexType name=questions> <xsd:sequence> <xsd:element name=location type=location/> <xsd:element name=multipleChoiceInput type=multipleChoiceInput
Ok I have the following, set-up and working great. These lines of code should
I have the following Ruby code: # func1 generates a sequence of items derived
I have the following lines of code: if( checker.this()==false || checker.that()==false || checker.what()==true|| checker.cool()==false
I have the following code that uses Sequence objects to read data from a
I have a code with the following sequence of lines: Socket echoSocket = null;
I have the following code sequence And I don't understand the compilation error (below
Given that we have the following View: <StackPanel> <TextBlock Text=Some text/> <Image Source={Binding vmImageProp}
I'm a newbie to regular expressions and I have the following string: sequence =
I have the following: <xs:schema> <xs:complexType name=NameType> <xs:sequence> <xs:element name=NamePrefix type=core:NamePrefixType minOccurs=0/> <xs:element name=FirstName

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.