Vim : File_put_contents Vs Fopen()

Discussion in 'Software' started by markem, Mar 24, 2026.

  1. markem

    markem Private First Class

    I use VIM as my editor. I've used VIM since the 1970s. So a really LONG time. Right? You'd think I knew everything about VIM - but no. Here is my problem:

    1. I'm using VIM. (Improved VI. VI is an editor from unix.)
    2. I want to write a file out to the disk drive.
    3. The problem is - if I use PHP's FILE_PUT_CONTENTS() function - everything works fine. But if I try to use FOPEN() I get an error.
    4. The error has to do with how PHP sees my account on my computer.

    FOPEN sees me as NORMAL
    But PHP FILE_PUT_CONTENTS() sees me as ABBY/NORMAL.

    (Yes, that is a joke - but it is what is happening. The reason this is happening is because Microsoft logs me in as just NORMAL but the system only has ABBY/NORMAL as the actual account. So I'm unsure how to fix this problem. And this ONLY happens in VIM. Every other editor I have used works correctly but I have to use the only wonky editor out there. (Truth is - I got at only 10% of my speed when using VIM. Because I have used it for that long.)

    Here is the actual error:

    Error #2 IN D:\My Programs\qb64\Plotter\html2pdf.php @271
    Content: fopen(D:\My Programs\qb64\Plotter/qb64phoenix): failed to open stream: Permission denied


    Ideas? (And please - no Young Frankenstein jokes!)
     
  2. markem

    markem Private First Class

    Ugh. Time limit expired to edit. So...

    I checked this by doing:

    echo "current user: ".get_current_user() . "\n";

    echo "script was executed under user: ".exec('whoami') . "\n";

    Which gave me:

    current user: Normal
    script was executed under user: Abby\Normal

    (Yes, I did change the names. "Normal" is my account name and "Abby" is the computer's name.)

    The big question is - shouldn't both of the commands use the same account information?
     
  3. markem

    markem Private First Class

    Ugh. Figured it out. Please delete this post. Thanks!

    Answer - I was trying to write to the DIRECTORY file instead of the page.dat file.

    Just Ugh.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds