1

I write a C++ code:

#include <iostream>
#include <string>


using namespace std;

int main()
{
    string password;
    cout << "Ingrese su password: " << "\n";
    getline( cin, password, '\n' );

    if ( password == "xyz123" )
        {
            cout << "Access Permitido" << "\n";
        }
    else
        {
            cout << "XD!, Acceso Denegado" << "\n";
            // returning is a convenient way to stop the program
            return 0;
        }
    // continue onward!
}

It run on Windows! I write nano password.cpp and then the following error appears:

Error opening file locking "./. password.cpp.swp":...

error opening file locking "./. password.cpp.swp":...

1
  • So... the file is located on a Windows partition, and you are trying to edit it from Ubuntu using nano? – steeldriver Sep 22 '16 at 18:12
2

Use the command

rm .password.cpp.swp

This should remove the temporary file generated by nano. After that, you can try opening it again with nano.

4
  • you can not erase password.cpp.swp, the file does not exist – ubuntux Sep 22 '16 at 18:09
  • with the starting point:you can not erase .password.cpp.swp, the file does not exist – ubuntux Sep 22 '16 at 18:10
  • 1
    Can you try copying the file to ~/Documents or something and try opening it from there? – Mido Sep 22 '16 at 18:13
  • 1
    The file isn't in Güin2, so a erase it, and write all again in a new fle, and it works, thanks for all anyway, XD.. – ubuntux Sep 26 '16 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.