I am using Matlab to create a new file by calling
fid = fopen(filename,'w')
since filename doesn't exist, it should create a new file and give me a valid file descriptor. Instead it returns -1. If I run the code again however, I get fid = 3.
This is being run on ubuntu but it apparently works fine on windows and I can't figure out why.
-Mike
not sure if this helps, but note that if the folder doesn't exist, fopen with 'w' can't create the file and so returns -1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With