brel-logo-white brel-logo-white
  • Travel
  • Case Study
  • How to
  • Technology
  • More
    • Sports
    • Health
    • Articles
    • Review
Notification
  • HomeHome
  • Finance
  • Health
  • Lifestyle
  • Sports
  • Contact Us
BreldigitalBreldigital
  • HomeHome
  • Finance
  • Health
  • Lifestyle
  • Sports
  • Contact Us
Search
  • Quick Access
    • Home
    • History
    • My Saves
    • My Interests
    • My Feed
  • Categories
    • Travel
    • Sports
    • Health

Top Stories

Explore the latest updated news!

How many solutions exist for the given equation? 3x + 13 = 3(x + 6) + 1 zero one two infinitely many

What is a best practice when approaching an automation effort

How does using mynav allow accenture to help its clients become more sustainable?

Stay Connected

Find us on socials
248.1k Followers Like
61.1k Followers Follow
165k Subscribers Subscribe
Breldigital > Blog > ds > Fopen javascript example
ds

Fopen javascript example

By Allen Kazadi Published May 2, 2023
Share

How to read and write a file using javascript?

Answer:

Files can be read and written by using java script functions – fopen(),fread() and fwrite().

The function fopen() takes two parameters – 1. Path and 2. Mode (0 for reading and 3 for writing). The fopen() function returns -1, if the file is successfully opened.

Ex: file=fopen(getScriptPath(),0);

The function fread() is used for reading the file content.

Ex: str = fread(file,flength(file));

The function fwrite() is used to write the contents to the file.

Ex(): file = fopen(“c:\MyFile.txt”, 3);// opens the file for writing

fwrite(file, str);// str is the content that is to be written into the file.

 

Fopen javascript example

Read more: When someone clicks your ad the actual amount you’re charged will be

TAGGED: Fopen javascript example
Allen Kazadi May 3, 2023 May 3, 2023
By Allen Kazadi
Follow:
Allen is a Technology guy, He basically works on Top articles related to Technology, Gadgets, and more. To know more about his work.

Search

brel-logo-white brel-logo-white
Explore a wide range of brands and categories with our comprehensive coverage, and stay up-to-date with the latest news and trends by subscribing to our updates.
Categories:
  • Entertainment
  • Travel
  • Sport
  • Contact Us

Quick Links

  • My Feed
  • My Interests
  • History
  • My Saves

About US

  • Adverts
  • Our Jobs
  • Term of Use

© 2023 Brel Digital All Rights Reserved. All logos and images used on this website are registered trademarks of their respective companies

Welcome Back!

Sign in to your account

Lost your password?