I have recently downloaded vb6.o project file from bitbucket but unable to run project it generates following error in log files
'0' could not be loaded
Line 0: The file E:\cas\Forms\errorform.frm could not be loaded.
I've seen this when the line endings for the vb6 files are converted from cr\lf to just lf.
For me this was caused by checking the source code out from git with autocrlf configured wrong.
Once I had git configured correctly, I needed to execute the following to reset all the line endings in my working copy:
git rm -rf --cached .
git reset --hard HEAD
Warning The above commands will delete all of your working copy files and recheck them out.
Credit
Try open the file with notepad++ and go to the menu View > Show Symbol > Show End of Line.
If you saw the file content is not windows standard (CRLF), then go to the menu Edit > EOL Conversion > Windows (CR LF).
The error means VB6 can't find one of the source files.
E:\cas\Forms\errorform.frm
Maybe the vbp file has a full path for the form rather than just the filename? Check the vbp in a text editor like Notepad.
Do you have a file errorform.frm from bitbucket? Maybe the file is missing from the archive.
Related
I don't know if I' missing something here, but this is my current situation:
GIT Repo checked out on Windows machine
Line endings are automatically converted (autocrlf = true)
installed WSL with Ubuntu
There are some Bash scripts in this repo that I want to execute via WSL. It doesn't work out-of-the-box due to the auto-converted line endings. So my current solution is to convert the script before execution with dos2unix.
Is there a fancy solution out there to get it working without manually converting the files?
I think what you want is when you do a git pull it should automatically convert them to LF (\n) so you can run the files, and then on commit, you want them to be committed at CRLF (\r\n). Here's what you want:
git config core.autocrlf false
Inside your project .gitattributes file:
* text eol=crlf
Now there are probably only certain file types you want automatically converted. So for example, if they were .sh files, you would modify the .gitattributes file to:
*.sh text eol=crlf
So I submitted a line on Git Bash "touch README.txt -m '...asdf ... qwer...' " attempting to create a readme file with text inside (I'm obviously new to this haha). The result was an empty README.txt file and a random file titled '...asdf ... qwer...' with filetype "file" that I can't get rid of. When I try to delete or alter it, a window pops up that says "Could not find this item. ... This is no longer located in [location]. Verify the location and try again." The Git GUI doesn't seem to recognize it either and I can't delete the parent directory. Command line deletion (del /r /q "...") was unsuccessful. Tried rebooting as well to see if it disappeared. It is not a hidden file.
What exactly happened here and how do I get rid of it? Thanks!
I had a similar issue trying to delete a file that "no longer existed" on my Windows 10 PC. What worked for me was adding the problem file(s) to an archive and ensuring the option, "Delete files after compression" (or equivalent option) in the archive software was ticked. Once the archive process completed, the problem file disappeared from the folder. I then deleted the archive file and everything was good to go.
To add the file to an archive make sure you have something like 7-Zip or WinRAR installed. Here's an example using 7-Zip:
Right-click the problem file and select "7-Zip" from the context menu followed by the "Add to archive" option.
In the "Add to Archive" dialogue, tick the "Delete files after compression" option.
Select the OK button.
The problem file will disappear and an archive file will appear in your folder in its place (hopefully!).
Delete the archive file.
Hope this works for you too.
This question already has answers here:
How do I manually create a file with a . (dot) prefix in Windows? For example, .htaccess
(17 answers)
Closed 3 years ago.
I tried to create a .gitignore file in my repository's root directory with the command
$ touch .gitginore
in Git Bash.
But when I looked at the file from the Windows Explorer. It says it's a text document. Isn't it supposed to be of the type File?
touch .gitignore works just fine. Windows detects it as a text file but git should works perfectly.
To be sure of it, you can type ls -la and you should see all your files with their extensions, including .gitignore just like in the following picture:
Since the question does not specify any required tools, this contains a solution if you want to create a .gitignore file using command prompt or Windows Explorer.
Command Prompt:
In case one receives the following error message on a Windows 10 system in command prompt because touch is a command of git bash:
'touch' is not recognized as an internal or external command, operable
program or batch file.
You can either use the following command in command prompt (cmd):
echo. > .gitignore
or
type nul > .gitignore
as indicated here: Windows equivalent of 'touch' (i.e. the node.js way to create an index.html). This procedure will not generate a Text Document as indicated in the problem statement, but a file that appears to not have any extension.
Windows Explorer:
If you try to do it in Windows 10 Explorer by clicking right mouse button(RMB)>New>Text Document and you try to name it .gitignore you can receive the following error:
You must type a file name.
This can be overcome by giving it the filename .gitignore.. So if your git repository folder contains a folder named output which you want to suppress/not sync, you can add it to the .gitignore by editing the .gitignore. file with a text editor and adding a line that contains /output. This last procedure generates a file which is also a .txt document as indicated in the problem statement, but as mentioned by #hobbs and #Youkool that is not a problem for git. Furthermore, the last procedure is verified in Windows 10 with git version 2.16.1.windows.4.
but when I looked at the file from the windows explorer. It says it's a text document. Isn't it supposed to be of the type File
Windows says your README is of type File because it has no extension. In contrast, your .gitignore file has the extension .gitignore which Windows has been configured to report (probably by the git-for-windows installer) the type Text Document.
Please refer to How do I manually create a file with a . (dot) prefix in Windows? For example, .htaccess.
Reproducing for your easy access: In File Explorer, right click anywhere and create a new file. Type the new filename as .something. (notice the appended period) and press Enter twice, job done.
Transferred over 50k files from my windows box to my ubuntu server and now git diff is showing all my files are modified with ^M at the line endings.
I tried changing the auto.crlf to true in the command line and it doesn't work.
And no I can't recopy this over again as I don't have access to the windows box anymore.
I've constantly run into this and I never found a simple way to fix this.
Isn't there a simple option in the command line git to just ignore these ^M line endings? I don't want to go through to having to make a script and reprocess all 50k files just to remove the ^M line endings.
auto crlf defines what happens during checkin and checkout.
If the files are already changed, then you may need to use a script after all. If you have the dos2unix utility available you could just run that and specify all the files.
In the meantime, make sure you have the auto crlf conversion setup the way you want it so this doesn't come up again.
I am setting up my first project in Git. How do I setup git-ignore file in Windows?
I am creating my first Rails project using Vagrant and trying to configure .gitignore in Windows
Easy.
Make a file .gitignore using your text editor
In there, write the file name you'd want to ignore
You can use wildcard like: *.pyc ignoring any file with extension .pyc
If you use TortoiseGit or other Git software, it will be easier. There will be add to ignore list menu when you right click to a file.
It seems that for ignoring files and directories there are two main ways:
.gitignore
Placing .gitignore file into the root of your repo besides .git
folder (in Windows make sure you see the true file extension and then
make .gitignore.
Making global configuration %HOMEPATH%\.gitignore_global and running
git config --global core.excludesfile %HOMEPATH%\.gitignore_global
to add this to your git config.
Note: files tracked before can be untracked by running git rm --cached filename. This absolutely critical for repos that existed BEFORE you created the .gitignore
Repo exclude
For local files that doesn't need to be shared, you just add file pattern or directory to file .git\info\exclude. These rules are not committed, so are not seen by other collaborators in your project. These are machine specific configs.
Windows does not allow you to create a "dotfile" (i.e., a file whose name begins with a dot). There are three simple ways to create a .gitignore in Windows, though. In each case, you want the .gitignore in your project's root directory.
In your text editor, create a file and "Save" or "Save As". Name the file ".gitignore" and the text editor works around the OS's limitation. I use Sublime Text 3 and Vim. This method works for both (Vim would use the command :w, though).
A fallback would be to create an empty (for now) text file and save it as .gitignore.txt then go into the command shell and rename the file to .gitignore (using the command line). That will do it.
Git Bash (available in the git installer for Windows) has the "touch" command and it will create dotfiles. At the Git Bash prompt enter the command "touch .gitignore" and an empty file is created if no file existed with that name.
Add your exclusion rules inside the .gitignore file:
Starting point. This repo will give you sample exclusion patterns for (i) Windows, (ii) Rails and (iii) Vagrant. You could add those to a global gitignore file.
GitIgnore / Patterns. This section of the Git Manual explains the patterns to use in your new gitignore file. Basically, you exclude directories and files that don't need version control.
To add to previous answers that you should use a text editor to create the .gitignore file, I usually first run dir > .gitignore from a Windows command prompt or Powershell window.
This outputs the entire directory listing to a file named .gitignore .
Then it's very easy to use a text editor (e.g., Notepad ++ or Atom) to modify the file from the directory listing and not miss a file or mistype a file name.
For Windows 10 I used:
ls > .gitignore
to create a clean .gitignore file ready to just delete lines where using 'dir' I would have had to also edit out all the explanatory directory text. I needed this when vscode told me I had 5K changes after I added a virtual environment to an existing project.