LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-03-2015, 11:58 AM   #16
Ihatewindows522
Member
 
Registered: Oct 2014
Location: Fort Wayne
Distribution: Ubuntu 16.04 LTS
Posts: 616
Blog Entries: 2

Rep: Reputation: 166Reputation: 166

1. You don't. You have to ask an admin like jeremy or unSpawn.
2. We're not even sure if the program is the problem. It very well could be with Ubuntu and some security misfeature.

If you wanted to have others critique your C# code to make sure it is bug free and works as intended, start a new thread in Programming. If this thread were to be moved anywhere it should probably be to the Servers forum.


As far as Apache goes, you might want to give this a read for starting and stopping your web server.
 
Old 06-03-2015, 12:05 PM   #17
Ihatewindows522
Member
 
Registered: Oct 2014
Location: Fort Wayne
Distribution: Ubuntu 16.04 LTS
Posts: 616
Blog Entries: 2

Rep: Reputation: 166Reputation: 166
I had forgot about an online service that debugs code. I used it quite frequently with JS and Python. Don't know the first thing about C#, but I pasted your code into IDEone.com and it came up with a runtime error.

http://ideone.com/9qepEH

What happen if you compile it and run it under Ubuntu?

Last edited by Ihatewindows522; 06-03-2015 at 12:06 PM.
 
Old 06-03-2015, 12:24 PM   #18
SCSIraidGURU
Member
 
Registered: Oct 2014
Posts: 69

Original Poster
Rep: Reputation: Disabled
Both PathA and PathB are on my local boxes. Online debuggers will error on them. I figure the error message is a file lock that causes the directory path to no be available all the time. So it could be Apache locking it. I figured I would stop the services before backup and restart it after. My friends who are programmers said C# is similar to Java. I already know pascal, C++, cobol, and many other languages.

Code compiles fine in Visual Studio. I can create the EXE. Running in Windows or Linux caused the error.

Last edited by SCSIraidGURU; 06-03-2015 at 12:26 PM.
 
Old 06-03-2015, 12:40 PM   #19
Ihatewindows522
Member
 
Registered: Oct 2014
Location: Fort Wayne
Distribution: Ubuntu 16.04 LTS
Posts: 616
Blog Entries: 2

Rep: Reputation: 166Reputation: 166
I'm nearing my wit's end on this if it is with the C#. I would go ahead and post in the programming forum and in the server forum to tackle both and see which is the culprit. By now this is definitely not a n00b issue.
 
Old 06-03-2015, 12:49 PM   #20
SCSIraidGURU
Member
 
Registered: Oct 2014
Posts: 69

Original Poster
Rep: Reputation: Disabled
C# is not difficult to learn. Classes are tricky. Google is your friend in writing code. Visual Studio contains Java, C# and a few other compilers. I belong to the IEEE Computer Society. It has 5000 classes and books on everything IT. The VMware books were helpful. C# book could be better written. At work, I run a corporate data center. My configuration files for the blade center, Layer 3 switches, and firewall were taken by the manufacturers because I did things they never thought of. I have 30+ years of programming experience.
 
Old 06-04-2015, 07:59 AM   #21
SCSIraidGURU
Member
 
Registered: Oct 2014
Posts: 69

Original Poster
Rep: Reputation: Disabled
Disabling Apache2 helped with the problem. I reverted back my Ubuntu Tape server to Windows XP x64 with Symantec Backup Exec 2010. Bacula has been nothing but a disappointment. Linux apps lack the professional installation of Windows apps. I should not have to manually modify 20+ files to get Bacula working. Bacula is not worth $2500. At best $25.

I am getting closer to finishing this program.
 
Old 06-04-2015, 10:03 AM   #22
SCSIraidGURU
Member
 
Registered: Oct 2014
Posts: 69

Original Poster
Rep: Reputation: Disabled
Disabled Apache2. The program ran fine once. Switched back to XP Pro and Symantec Backup Exec 2010 last night. Did a tape backup. So I did not have time to figure out why the copy paths are wrong.

Finding a way to disable Apache2 in C# and enable it at the end of the program.
 
Old 06-10-2015, 07:21 AM   #23
Ihatewindows522
Member
 
Registered: Oct 2014
Location: Fort Wayne
Distribution: Ubuntu 16.04 LTS
Posts: 616
Blog Entries: 2

Rep: Reputation: 166Reputation: 166
Can you call a bash script to do that from C#?
 
Old 06-10-2015, 08:43 AM   #24
SCSIraidGURU
Member
 
Registered: Oct 2014
Posts: 69

Original Poster
Rep: Reputation: Disabled
The two errors are related to anti-virus. Avast Internet Security scans everything and is causing the issue. I have been working with Avast engineers on it. I tried running the application from Ubuntu instead of Windows. Same errors. Definitely, anti-virus getting in the way. Turning off Avast does not help.
 
Old 06-10-2015, 09:07 AM   #25
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
is the op trying to re-invent rsync ?
 
Old 06-10-2015, 09:27 AM   #26
SCSIraidGURU
Member
 
Registered: Oct 2014
Posts: 69

Original Poster
Rep: Reputation: Disabled
In a way, I am trying to re-invent rsync, I guess. I am learning C# programming at a higher level to actually write professional software. File manipulation, databases and ASP.Net are what I need to know. This error is the only thing stopping my program from working. When it finished, it actually does work and is fast. rsync might be interesting to look at.

What the program does is?
1.) Compares var/www to the backup drive
2.) Creates directories that don't exist on the backup drive
3.) Writes files that have changed or are new to the backup drive

The errors I am getting have been a problem for programmers for a while.

I am not sure if Bash would return a list like these commands.

System.IO.DirectoryInfo dirfile1 = new System.IO.DirectoryInfo(pathA);

IEnumerable<System.IO.DirectoryInfo> dirlist1 = dirfile1.GetDirectories("*.*", System.IO.SearchOption.AllDirectories);


System.IO.DirectoryInfo file1 = new System.IO.DirectoryInfo(pathA);

IEnumerable<System.IO.FileInfo> list1 = file1.GetFiles("*.*", System.IO.SearchOption.AllDirectories);


These commands build a list, dirlist1. The list contains all the attributes for each file and directory. I can look at path, full name, length of file, last write time, and other attributes to compare files with. I have been working on last write time in another program to merge into this one.
 
Old 06-10-2015, 09:32 AM   #27
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
^ man find ?
 
Old 06-10-2015, 09:58 AM   #28
SCSIraidGURU
Member
 
Registered: Oct 2014
Posts: 69

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by schneidz View Post
^ man find ?
This returns file names. Does it return full path names, paths, full names?

Once I get past the error, I can compile it and run it in Ubuntu.

W:\ is var/www
J:\ is my eSATA drive on my workstation.

J: is turned off when I am not using my workstation to protect the drive along with my workstation. The Ubuntu box is on 24x7. My program does a list first. It only copies the modified / new files to protect the hard drives for additional wear and tear looking at every file.
 
Old 06-10-2015, 10:04 AM   #29
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by SCSIraidGURU View Post
This returns file names. Does it return full path names, paths, full names?
...
ya, did you read the man page ?
(arent those the same thing ?)

Last edited by schneidz; 06-10-2015 at 10:07 AM.
 
Old 06-10-2015, 10:57 AM   #30
SCSIraidGURU
Member
 
Registered: Oct 2014
Posts: 69

Original Poster
Rep: Reputation: Disabled
Can I use those commands in C#? I backup all of my workstations and servers on tape drives that can be quickly recovered.


The web site was rewritten in CSS to learn CSS. C# is what I need to write Windows based databases. So your commands are interesting to try. 99.9 of C# programming is on Windows. My goal is to get through C# by September and start on ASP.Net.

Only reason I use Ubuntu is the web server works on my ISP, Wide Open West. They will not let me use a Windows server on a residential connection. It was Windows XP Pro x64 till Microsoft discontinued it. I converted my backup server back to XP Pro x64 running Symantec Backup Exec 2010 with my tape drives. Ubuntu and Bacula tape backup software sucked. It has no GUI. It kept crashing on backing up Windows 7 x64. I am glad I did not spend $2500 on Bacula. $1200 for Symantec BE 2010 was a good purchase.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Message When re-installing windows OVER ubuntu pjfunk2k Linux - General 2 07-14-2010 05:44 PM
I get an error message while trying to install vb (Virtual Box) thewhitelion Linux - Software 1 04-04-2007 02:48 AM
Remote Access to Windows Box hkillen Linux - Networking 4 09-20-2006 08:01 AM
shell error messages not displayed as a message box!!! user222 Linux - General 10 10-25-2004 01:11 AM
how do I access a fricken windows box hugosoto Linux - Networking 5 11-27-2002 03:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration