This document discusses file operations in Visual Basic 6 using built-in functions. It describes how to copy, rename, delete, and move files as well as check if a file exists. The key functions are FileCopy to copy files, Name to rename files, Kill to delete files, and Dir$ to check if a file exists before performing operations on it. Full file paths are recommended to avoid issues with the current directory.
This document provides an overview of the Linux operating system and how to use basic Linux commands. It explains that Linux is a free version of UNIX that is operated through a command line terminal rather than a graphical user interface. It also describes how to access the course Linux server using SSH and SFTP, navigate and manipulate files and directories using commands like ls, cd, cp, and rm, view file contents with cat and more, and get help with commands like man. Finally, it provides a list of common Linux shell commands and how to run and edit programs.
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
The Linux command line is a powerful tool. The majority of webservers run on Linux/Unix. Some hosting companies offer SSH access to their hosting environment. Via SSH you can login and use the Linux command line.
In this presentation, Peter will show you some time-saving command line commands that you can use for certain tasks on your Joomla websites:
some basic SSH command line commands
Analyzing & recovering a hacked website
Backup a website or move it to another server
Finding unused files
Setting up a test environment
This document provides information about file management and defragging computers. It discusses how over time as a computer saves information in different areas of the hard drive, it can lead to fragmentation that slows the computer's performance. Defragging reorganizes files in contiguous order on the hard drive to improve speed. The document outlines the steps to defragment a computer by accessing properties and clicking "defragment now". It also discusses managing files in Outlook by creating folders and archiving old items to free up space in the mailbox while maintaining important files in an archive location.
The document discusses different Linux commands for finding files and directories, including find, locate, and grep. It also covers input/output redirection using pipes (|), redirecting standard output and error (> and 2>) to files, and merging standard output and error streams (2>&1). Specific examples are provided on searching for files by name, date, permissions and size, ignoring case sensitivity, counting matches, and displaying line numbers.
This document provides an introduction to Linux and summarizes key topics including:
1. The history and development of Linux including influences from Multics and Unix as well as contributions from developers like Ken Thompson, Dennis Ritchie, and others.
2. Important related operating systems and distributions like BSD, Debian, Ubuntu, and others that helped shape Linux.
3. Core Linux concepts like the Unix philosophy, shells, files/file systems, users/permissions, and commands.
Part 6 of "Introduction to linux for bioinformatics": Productivity tipsJoachim Jacob
This is part 6 of the training "Introduction to linux for bioinformatics". Here we show basic tips to become rapidly more efficient on the command line. Interested in following this training session? Please contact me at http://www.jakonix.be/contact.html
This document provides an overview of why GNU/Linux is useful, where it is used, the different distributions, basics of the operating system like shell, directory structure, logging in, and commands. Some key benefits of GNU/Linux mentioned are that software is free, it enables advanced multitasking and networking, is multiuser, and provides access to programming languages and open source projects. Common distributions include Red Hat Linux, Debian, and SUSE. The document then covers basics like shell, directory structure, logging in, and demonstrates many common commands like ls, cat, cp, rm, mv, and their usage.
This document discusses user and group administration in Linux. It covers:
- Users must belong to at least one primary group and can belong to up to 15 secondary groups.
- The /etc/passwd, /etc/shadow, and /etc/group files store user and group information.
- Commands like useradd, usermod, and userdel are used to manage users, and groupadd, groupmod, and groupdel are used to manage groups.
- Cron jobs allow scheduling tasks to run on a defined schedule. Cron job schedules are stored in /var/spool/cron for each user, and cron activity is logged to /var/log/cron.
This document provides an overview of the Linux operating system and how to use basic Linux commands. It explains that Linux is a free version of UNIX that is operated through a command line terminal rather than a graphical user interface. It also describes how to access the course Linux server using SSH and SFTP, navigate and manipulate files and directories using commands like ls, cd, cp, and rm, view file contents with cat and more, and get help with commands like man. Finally, it provides a list of common Linux shell commands and how to run and edit programs.
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
The Linux command line is a powerful tool. The majority of webservers run on Linux/Unix. Some hosting companies offer SSH access to their hosting environment. Via SSH you can login and use the Linux command line.
In this presentation, Peter will show you some time-saving command line commands that you can use for certain tasks on your Joomla websites:
some basic SSH command line commands
Analyzing & recovering a hacked website
Backup a website or move it to another server
Finding unused files
Setting up a test environment
This document provides information about file management and defragging computers. It discusses how over time as a computer saves information in different areas of the hard drive, it can lead to fragmentation that slows the computer's performance. Defragging reorganizes files in contiguous order on the hard drive to improve speed. The document outlines the steps to defragment a computer by accessing properties and clicking "defragment now". It also discusses managing files in Outlook by creating folders and archiving old items to free up space in the mailbox while maintaining important files in an archive location.
The document discusses different Linux commands for finding files and directories, including find, locate, and grep. It also covers input/output redirection using pipes (|), redirecting standard output and error (> and 2>) to files, and merging standard output and error streams (2>&1). Specific examples are provided on searching for files by name, date, permissions and size, ignoring case sensitivity, counting matches, and displaying line numbers.
This document provides an introduction to Linux and summarizes key topics including:
1. The history and development of Linux including influences from Multics and Unix as well as contributions from developers like Ken Thompson, Dennis Ritchie, and others.
2. Important related operating systems and distributions like BSD, Debian, Ubuntu, and others that helped shape Linux.
3. Core Linux concepts like the Unix philosophy, shells, files/file systems, users/permissions, and commands.
Part 6 of "Introduction to linux for bioinformatics": Productivity tipsJoachim Jacob
This is part 6 of the training "Introduction to linux for bioinformatics". Here we show basic tips to become rapidly more efficient on the command line. Interested in following this training session? Please contact me at http://www.jakonix.be/contact.html
This document provides an overview of why GNU/Linux is useful, where it is used, the different distributions, basics of the operating system like shell, directory structure, logging in, and commands. Some key benefits of GNU/Linux mentioned are that software is free, it enables advanced multitasking and networking, is multiuser, and provides access to programming languages and open source projects. Common distributions include Red Hat Linux, Debian, and SUSE. The document then covers basics like shell, directory structure, logging in, and demonstrates many common commands like ls, cat, cp, rm, mv, and their usage.
This document discusses user and group administration in Linux. It covers:
- Users must belong to at least one primary group and can belong to up to 15 secondary groups.
- The /etc/passwd, /etc/shadow, and /etc/group files store user and group information.
- Commands like useradd, usermod, and userdel are used to manage users, and groupadd, groupmod, and groupdel are used to manage groups.
- Cron jobs allow scheduling tasks to run on a defined schedule. Cron job schedules are stored in /var/spool/cron for each user, and cron activity is logged to /var/log/cron.
The document provides information on basic Linux commands for working with files, permissions, users and running levels. Some key points:
- Commands like ls, du, df, free are used to view disk usage, files, permissions and available memory. chmod, chown, chgrp change file/folder permissions and ownership.
- Permissions are represented by rwx for read, write and execute for the user, group and others. Numerical values like 755 can set complex permission schemes.
- Linux has 7 run levels from 0-6 for different system states like shutdown, single-user mode, multi-user with networking. Services are started via links in run level directories.
- Common commands
The document discusses various text editors and process management in Linux. It covers the vi text editor including starting vi, editing files, saving files, and exiting vi. It also discusses the two modes of vi - insert mode and command mode. For process management, it defines what a process is, provides commands like ps and kill to view and terminate processes, and describes zombie processes and how to remove them.
The document provides information on various tools used for backups, compression, decompression, and network troubleshooting in Linux. It discusses gzip, bzip2, zip, and tar for compressing and archiving files. It also covers scp for securely copying files over SSH, cURL and wget for downloading files from the web, and network troubleshooting tools like ping, ifconfig, netstat, and telnet.
The document provides an overview of Linux commands and the command line interface. It discusses:
1. Why the command line interface is useful and how to open the terminal emulator.
2. The different types of shells available in Linux and how to check the current shell or change shells.
3. Common Linux directory structures like /bin and /usr/bin that contain executable programs and commands.
This document provides an overview of basic Unix commands including ls, cd, pwd, mkdir, rm, rmdir, cp, find, touch, echo, cat, who, and du. It explains what each command is used for and provides examples of common usages. The document serves as a beginner's guide to learning Unix commands.
This document provides an overview of 27 basic Linux commands, including ls to list files, rm to remove files, rmdir to remove empty directories, cat to display file contents, cd to change directories, mv to move/rename files, who to display logged in users, mkdir to create directories, cp to copy files, and man to view command manuals. It also covers commands for permissions (chmod), clearing the screen (clear), viewing users (w), remote login (telnet), creating files (touch), editing files (vi), displaying date and time (date), viewing calendar (cal), showing IP address (ifconfig), and hostname.
Tar is used to archive and compress files and directories in Linux. It can be installed using yum or apt-get depending on the distribution. Tar creates archives with options like c for create and z for gzip compression. The split and cat commands can be used to split large tar files into parts and combine them. Sed is used for text editing and search/replace tasks in files. The useradd and group commands are used for user and group management like creating, modifying, and deleting users and groups.
This document provides information on basic Linux commands and how to perform common system administration tasks in Ubuntu Server, including:
1. Adding and removing users, changing passwords, and enabling the root user.
2. Configuring network interfaces like Ethernet, setting the IP address, default gateway, and DNS servers.
3. Starting, stopping, and restarting network and other services.
4. Updating the Ubuntu Server using the software updater.
Linux is an operating system similar to Unix. The document lists and describes 27 common Linux commands, including commands for listing files (ls), removing files and directories (rm, rmdir), viewing file contents (cat, more, less), navigating and creating directories (cd, mkdir), moving and copying files (mv, cp), searching files (grep), counting characters (wc), checking the current working directory (pwd), getting command help (man), finding files and programs (whereis, find, locate), editing files (vi, emacs), connecting remotely (telnet, ssh), checking network status (netstat, ifconfig), getting information about internet hosts (whois, nslookup, dig, finger), testing network connectivity
This document provides an overview of basic Linux commands, including man for accessing manual pages, ls for listing directory contents, mkdir for creating directories, cd for changing directories, pwd for printing the working directory, and ~ for accessing the home directory. It also covers commands for copying, moving, removing files, clearing the screen, viewing file contents, searching within files, counting words, piping commands together, using wildcards, and changing file permissions with chmod. The document encourages learning through manual pages and understanding error messages.
Linux Administrator - The Linux Course on EduonixPaddy Lock
Daily tasks of a Linux administrator include package management, ensuring system security through regular backups and updating of software and patches, and monitoring system performance and anticipating potential issues. When issues do arise, Linux administrators must be able to effectively use documentation like man pages to troubleshoot problems. Choosing an appropriate Linux distribution depends on factors such as software compatibility, vendor support policies, and patch release schedules.
50 most frequently used unix linux commands (with examples)Rodrigo Maia
This document provides examples for 50 common Linux commands, including tar, grep, find, ssh, sed, awk, vim, diff, sort, and more. It explains practical uses for each command and provides short code snippets to demonstrate basic functionality. The commands cover a wide range of tasks like archiving, searching, editing, comparing, and managing files, processes and system resources.
OpenGurukul : Operating System : LinuxOpen Gurukul
This document provides a summary of Linux file systems and commands. It discusses common file system commands like pwd, cd, mkdir, touch, cat, head, tail, more, less, ls, cp, mv and ln. It explains what each command does, basic syntax and examples of using the commands to navigate the file system, view file contents, create/modify files and directories and copy or move files.
P2Cinfotech is one of the leading, Online IT Training facilities and Job Consultant, spread all over the world. We have successfully conducted online classes on various Software Technologies that are currently in Demand. To name a few, we provide quality online training for QA, QTP, Manual Testing, HP LoadRunner, BA, Java Technologies.
Unique Features of P2Cinfotech:
1. All online software Training Batches will Be handled by Real time working Professionals only.
2. Live online training like Real time face to face, Instructor ? student interaction.
3. Good online training virtual class room environment.
4. Special Exercises and Assignments to make you self-confident on your course subject.
5. Interactive Sessions to update students with latest Developments on the particular course.
6. Flexible Batch Timings and proper timetable.
7. Affordable, decent and Flexible fee structure.
8. Extended Technical assistance even after completion of the course.
9. 100% Job Assistance and Guidance.
Courses What we cover:
Quality Assurance
Business Analsis
QTp
JAVA
Apps Devlepoment Training
Register for Free DEMO:
www.p2cinfotech.com p2cinfotech@gmail.com +1-732-546-3607 (USA)
This document contains 49 multiple choice questions about various Linux commands and concepts. The questions cover topics such as common commands (e.g. ls, cd), file system navigation, permissions, processes, networking and system administration tasks. Each question is followed by 4 possible answer choices.
The document provides an overview of the history and development of the UNIX operating system from 1965 to 1983. It describes how UNIX originated from the Multics project at Bell Labs and MIT in 1965. It was further developed by AT&T in the 1970s and rewritten in C by Dennis Ritchie in 1973. The document also discusses the development of BSD and System V UNIX variants in the 1980s.
These slides were presented by Dan Gillean at the first ever AtoM Camp, held at the SFU Harbour Centre in Vancouver, BC, Canada, March 20-22, 2017. For more information on the Camp, see:
https://wiki.accesstomemory.org/Community/Camps/SFU2017
These slides introduce participants to basic commands in the linux/unix command-line interface, for navigation and basic tasks such as reading, creating, deleting, and moving files. The slides were intended as an initial introduction for archivists unfamiliar with using the command-line, prior to teaching them about the command-line tasks available in Access to Memory (AtoM), which can be used for maintenance and troubleshooting.
This document provides information about immigration options for foreign entrepreneurs seeking to start companies in the United States. It discusses various visa categories for foreign founders, including L-1 visas for internal company transfers, E-1 and E-2 visas for treaty trader/investor status, H-1B visas for specialty occupations, and O-1 visas for individuals with extraordinary ability. It also mentions EB-5 investor visas and options for incorporation in Delaware or Cayman Islands. Resources for startup accelerators and incubators are listed, along with live stream videos and contacts for further information.
This document discusses a product called Task Killer that is designed to kill mosquitoes. It lists the group members working on the project and then discusses how mosquitoes can cause diseases like dengue fever, malaria, and Rift Valley fever, killing over a million people per year. It outlines some competitors in the market for mosquito control and then lists key features of Task Killer like its long battery life, solar charging, fragrance, and noiseless operation. Benefits are noted as being harmless to humans but killing insects instantly in an eco-friendly way. The price is planned to be around Rs. 299 to compete in the market. A SWOT analysis identifies strengths, weaknesses, opportunities and threats. The tagline is also
The document provides information on basic Linux commands for working with files, permissions, users and running levels. Some key points:
- Commands like ls, du, df, free are used to view disk usage, files, permissions and available memory. chmod, chown, chgrp change file/folder permissions and ownership.
- Permissions are represented by rwx for read, write and execute for the user, group and others. Numerical values like 755 can set complex permission schemes.
- Linux has 7 run levels from 0-6 for different system states like shutdown, single-user mode, multi-user with networking. Services are started via links in run level directories.
- Common commands
The document discusses various text editors and process management in Linux. It covers the vi text editor including starting vi, editing files, saving files, and exiting vi. It also discusses the two modes of vi - insert mode and command mode. For process management, it defines what a process is, provides commands like ps and kill to view and terminate processes, and describes zombie processes and how to remove them.
The document provides information on various tools used for backups, compression, decompression, and network troubleshooting in Linux. It discusses gzip, bzip2, zip, and tar for compressing and archiving files. It also covers scp for securely copying files over SSH, cURL and wget for downloading files from the web, and network troubleshooting tools like ping, ifconfig, netstat, and telnet.
The document provides an overview of Linux commands and the command line interface. It discusses:
1. Why the command line interface is useful and how to open the terminal emulator.
2. The different types of shells available in Linux and how to check the current shell or change shells.
3. Common Linux directory structures like /bin and /usr/bin that contain executable programs and commands.
This document provides an overview of basic Unix commands including ls, cd, pwd, mkdir, rm, rmdir, cp, find, touch, echo, cat, who, and du. It explains what each command is used for and provides examples of common usages. The document serves as a beginner's guide to learning Unix commands.
This document provides an overview of 27 basic Linux commands, including ls to list files, rm to remove files, rmdir to remove empty directories, cat to display file contents, cd to change directories, mv to move/rename files, who to display logged in users, mkdir to create directories, cp to copy files, and man to view command manuals. It also covers commands for permissions (chmod), clearing the screen (clear), viewing users (w), remote login (telnet), creating files (touch), editing files (vi), displaying date and time (date), viewing calendar (cal), showing IP address (ifconfig), and hostname.
Tar is used to archive and compress files and directories in Linux. It can be installed using yum or apt-get depending on the distribution. Tar creates archives with options like c for create and z for gzip compression. The split and cat commands can be used to split large tar files into parts and combine them. Sed is used for text editing and search/replace tasks in files. The useradd and group commands are used for user and group management like creating, modifying, and deleting users and groups.
This document provides information on basic Linux commands and how to perform common system administration tasks in Ubuntu Server, including:
1. Adding and removing users, changing passwords, and enabling the root user.
2. Configuring network interfaces like Ethernet, setting the IP address, default gateway, and DNS servers.
3. Starting, stopping, and restarting network and other services.
4. Updating the Ubuntu Server using the software updater.
Linux is an operating system similar to Unix. The document lists and describes 27 common Linux commands, including commands for listing files (ls), removing files and directories (rm, rmdir), viewing file contents (cat, more, less), navigating and creating directories (cd, mkdir), moving and copying files (mv, cp), searching files (grep), counting characters (wc), checking the current working directory (pwd), getting command help (man), finding files and programs (whereis, find, locate), editing files (vi, emacs), connecting remotely (telnet, ssh), checking network status (netstat, ifconfig), getting information about internet hosts (whois, nslookup, dig, finger), testing network connectivity
This document provides an overview of basic Linux commands, including man for accessing manual pages, ls for listing directory contents, mkdir for creating directories, cd for changing directories, pwd for printing the working directory, and ~ for accessing the home directory. It also covers commands for copying, moving, removing files, clearing the screen, viewing file contents, searching within files, counting words, piping commands together, using wildcards, and changing file permissions with chmod. The document encourages learning through manual pages and understanding error messages.
Linux Administrator - The Linux Course on EduonixPaddy Lock
Daily tasks of a Linux administrator include package management, ensuring system security through regular backups and updating of software and patches, and monitoring system performance and anticipating potential issues. When issues do arise, Linux administrators must be able to effectively use documentation like man pages to troubleshoot problems. Choosing an appropriate Linux distribution depends on factors such as software compatibility, vendor support policies, and patch release schedules.
50 most frequently used unix linux commands (with examples)Rodrigo Maia
This document provides examples for 50 common Linux commands, including tar, grep, find, ssh, sed, awk, vim, diff, sort, and more. It explains practical uses for each command and provides short code snippets to demonstrate basic functionality. The commands cover a wide range of tasks like archiving, searching, editing, comparing, and managing files, processes and system resources.
OpenGurukul : Operating System : LinuxOpen Gurukul
This document provides a summary of Linux file systems and commands. It discusses common file system commands like pwd, cd, mkdir, touch, cat, head, tail, more, less, ls, cp, mv and ln. It explains what each command does, basic syntax and examples of using the commands to navigate the file system, view file contents, create/modify files and directories and copy or move files.
P2Cinfotech is one of the leading, Online IT Training facilities and Job Consultant, spread all over the world. We have successfully conducted online classes on various Software Technologies that are currently in Demand. To name a few, we provide quality online training for QA, QTP, Manual Testing, HP LoadRunner, BA, Java Technologies.
Unique Features of P2Cinfotech:
1. All online software Training Batches will Be handled by Real time working Professionals only.
2. Live online training like Real time face to face, Instructor ? student interaction.
3. Good online training virtual class room environment.
4. Special Exercises and Assignments to make you self-confident on your course subject.
5. Interactive Sessions to update students with latest Developments on the particular course.
6. Flexible Batch Timings and proper timetable.
7. Affordable, decent and Flexible fee structure.
8. Extended Technical assistance even after completion of the course.
9. 100% Job Assistance and Guidance.
Courses What we cover:
Quality Assurance
Business Analsis
QTp
JAVA
Apps Devlepoment Training
Register for Free DEMO:
www.p2cinfotech.com p2cinfotech@gmail.com +1-732-546-3607 (USA)
This document contains 49 multiple choice questions about various Linux commands and concepts. The questions cover topics such as common commands (e.g. ls, cd), file system navigation, permissions, processes, networking and system administration tasks. Each question is followed by 4 possible answer choices.
The document provides an overview of the history and development of the UNIX operating system from 1965 to 1983. It describes how UNIX originated from the Multics project at Bell Labs and MIT in 1965. It was further developed by AT&T in the 1970s and rewritten in C by Dennis Ritchie in 1973. The document also discusses the development of BSD and System V UNIX variants in the 1980s.
These slides were presented by Dan Gillean at the first ever AtoM Camp, held at the SFU Harbour Centre in Vancouver, BC, Canada, March 20-22, 2017. For more information on the Camp, see:
https://wiki.accesstomemory.org/Community/Camps/SFU2017
These slides introduce participants to basic commands in the linux/unix command-line interface, for navigation and basic tasks such as reading, creating, deleting, and moving files. The slides were intended as an initial introduction for archivists unfamiliar with using the command-line, prior to teaching them about the command-line tasks available in Access to Memory (AtoM), which can be used for maintenance and troubleshooting.
This document provides information about immigration options for foreign entrepreneurs seeking to start companies in the United States. It discusses various visa categories for foreign founders, including L-1 visas for internal company transfers, E-1 and E-2 visas for treaty trader/investor status, H-1B visas for specialty occupations, and O-1 visas for individuals with extraordinary ability. It also mentions EB-5 investor visas and options for incorporation in Delaware or Cayman Islands. Resources for startup accelerators and incubators are listed, along with live stream videos and contacts for further information.
This document discusses a product called Task Killer that is designed to kill mosquitoes. It lists the group members working on the project and then discusses how mosquitoes can cause diseases like dengue fever, malaria, and Rift Valley fever, killing over a million people per year. It outlines some competitors in the market for mosquito control and then lists key features of Task Killer like its long battery life, solar charging, fragrance, and noiseless operation. Benefits are noted as being harmless to humans but killing insects instantly in an eco-friendly way. The price is planned to be around Rs. 299 to compete in the market. A SWOT analysis identifies strengths, weaknesses, opportunities and threats. The tagline is also
This document does not contain any substantive information to summarize. It appears to be blank or contain only formatting characters with no meaningful text. In 3 sentences or less, a summary cannot be provided as there is no information within the given document to summarize.
Maroon refers to being stranded or abandoned, and also references the color maroon and the band Maroon 5. The word 'maroon' anchors related concepts together through its meaning of 'anchorage', subtly connecting references to being stranded, the color, and the band.
32 Ways a Digital Marketing Consultant Can Help Grow Your BusinessBarry Feldman
How can a digital marketing consultant help your business? In this resource we'll count the ways. 24 additional marketing resources are bundled for free.
The document discusses data files in Visual Basic. It provides 12 questions with explanations about key concepts related to data files, including:
1) The difference between a VB project file and data file is that a project file contains code modules while a data file stores information on the hard disk in records with fields.
2) The open statement reserves a file handle (channel) to read from and write to a file, associating a number to the handle for later access.
3) Common file modes are input, output, append, and random for different types of file access.
4) A file number maintains files in a project and is used instead of file names for reference.
Introduction to command line tools for *NIX (UNIX (like OS X and Solaris/SunOS), BSD, & GNU/Linux) environments. I made this presentation originally for the LUG@UCF when I was an undergrad but still contains valid information. Hope you find it useful.
There are 4 parts for the project. The question may be long to r.docxsusannr
There are 4 parts for the project. The question may be long to read but it's not a heavy work because there are many examples and explanations for the each parts.
*Part 1. The first part of this project requires that you implement a class that will be used to simulate a disk drive. The disk drive will have
numberofblocks
many blocks where each block has
blocksize
many bytes. The interface for the class
Sdisk
should include :
Class Sdisk
{
public :
Sdisk(string diskname, int numberofblocks, int blocksize);
int getblock(int blocknumber, string& buffer);
int putblock(int blocknumber, string buffer);
int getnumberofblocks(); // accessor function
int getblocksize(); // accessor function
private :
string diskname; // file name of software-disk
int numberofblocks; // number of blocks on disk
int blocksize; // block size in bytes
};
An explanation of the member functions follows :
Sdisk(diskname, numberofblocks, blocksize)
This constructor incorporates the creation of the disk with the "formatting" of the device. It accepts the integer values
numberofblocks
,
blocksize
, a string
diskname
and creates a Sdisk (software-disk). The Sdisk is a file of characters which we will manipulate as a raw hard disk drive. The function will check if the file
diskname
exists. If the file exists, it is opened and treated as a Sdisk with
numberofblocks
many blocks of size
blocksize
. If the file does not exist, the function will create a file called
diskname
which contains
numberofblocks*blocksize
many characters. This file is logically divided up into
numberofblocks
many blocks where each block has
blocksize
many characters. The text file will have the following structure :
-figure 0 (what I attached below)
getblock(blocknumber,buffer)
retrieves block
blocknumber
from the disk and stores the data in the string
buffer
. It returns an error code of 1 if successful and 0 otherwise.
putblock(blocknumber,buffer)
writes the string
buffer
to block
blocknumber
. It returns an error code of 1 if successful and 0 otherwise.
IMPLEMENTATION GUIDELINES
: It is essential that your software satisfies the specifications. These will be the only functions (in your system) which physically access the Sdisk.
NOTE
that you must also write drivers to test and demonstrate your program.
*Part 2. The second part of this project requires that you implement a simple file system. In particular, you are going to write the software which which will handle dynamic file management. This part of the project will require you to implement the class
Filesys
along with member functions. In the description below, FAT refers to the
File Allocation Table
and ROOT refers to the
Root Directory
. The interface for the class should include :
Class Filesys: public Sdisk
{
Public :
Filesys(string disk.
There are 4 part for the project and the question may be long to rea.docxsusannr
There are 4 part for the project and the question may be long to read but it's not a heavy work because there are many examples and explanations for the each parts.
*Part 1. The first part of this project requires that you implement a class that will be used to simulate a disk drive. The disk drive will have
numberofblocks
many blocks where each block has
blocksize
many bytes. The interface for the class
Sdisk
should include :
Class Sdisk
{
public :
Sdisk(string diskname, int numberofblocks, int blocksize);
int getblock(int blocknumber, string& buffer);
int putblock(int blocknumber, string buffer);
int getnumberofblocks(); // accessor function
int getblocksize(); // accessor function
private :
string diskname; // file name of software-disk
int numberofblocks; // number of blocks on disk
int blocksize; // block size in bytes
};
An explanation of the member functions follows :
Sdisk(diskname, numberofblocks, blocksize)
This constructor incorporates the creation of the disk with the "formatting" of the device. It accepts the integer values
numberofblocks
,
blocksize
, a string
diskname
and creates a Sdisk (software-disk). The Sdisk is a file of characters which we will manipulate as a raw hard disk drive. The function will check if the file
diskname
exists. If the file exists, it is opened and treated as a Sdisk with
numberofblocks
many blocks of size
blocksize
. If the file does not exist, the function will create a file called
diskname
which contains
numberofblocks*blocksize
many characters. This file is logically divided up into
numberofblocks
many blocks where each block has
blocksize
many characters. The text file will have the following structure :
-figure 0 (what I attached below)
getblock(blocknumber,buffer)
retrieves block
blocknumber
from the disk and stores the data in the string
buffer
. It returns an error code of 1 if successful and 0 otherwise.
putblock(blocknumber,buffer)
writes the string
buffer
to block
blocknumber
. It returns an error code of 1 if successful and 0 otherwise.
IMPLEMENTATION GUIDELINES
: It is essential that your software satisfies the specifications. These will be the only functions (in your system) which physically access the Sdisk.
NOTE
that you must also write drivers to test and demonstrate your program.
*Part 2. The second part of this project requires that you implement a simple file system. In particular, you are going to write the software which which will handle dynamic file management. This part of the project will require you to implement the class
Filesys
along with member functions. In the description below, FAT refers to the
File Allocation Table
and ROOT refers to the
Root Directory
. The interface for the class should include :
Class Filesys: public Sdisk
{
Public :
Filesys(string diskname, int numberofblocks, in.
There are 4 parts for the project. The question may be long to read .docxsusannr
This document outlines a 4 part project for implementing a disk drive simulator, file system, shell, and database table using the file system. Part 1 involves creating a class to simulate a disk drive with blocks. Part 2 creates a file system class to manage files dynamically using a file allocation table (FAT) and root directory. Part 3 develops a shell class to interface with the file system. Part 4 builds a database table class to store and search records from an input file using a flat file and index file.
This document discusses using Docker containers without Docker. It provides a Vagrantfile configuration to set up a virtual machine environment for experiments. The Vagrantfile configures a Ubuntu 18.04 virtual machine with Docker, Go, and other tools installed. The document then covers mounting namespaces and how to isolate the root filesystem of a process to emulate containers without Docker.
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS
The document provides an introduction to using the Linux command line for bioinformatics tasks. It covers navigating the file system, manipulating files and directories, input/output redirection, piping commands together, and commonly used text processing tools. The goal is to help users easily use command line tools, automate repetitive tasks, and parse/summarize text-based outputs.
The document provides an overview of key forensic artifacts and changes in the Windows Vista operating system. In 3 sentences:
Vista introduced changes to the Recycle Bin, encryption with EFS keys on smart cards, default folder organization with junction links, registry virtualization for non-admin writes, an updated thumbnail cache format, new event log format with .evtx extension, and use of volume shadow copies for restoring previous versions of files and retrieving deleted data through differential disk imaging. Analysis of Vista systems requires examining multiple registry hives and investigating artifacts like prefetch files, volume shadow copies, and the thumbnail cache for evidentiary value.
The document discusses Java input and output (I/O) fundamentals. It explains that all I/O in Java is performed by writing to and reading from streams of data. It also discusses the differences between text I/O using Reader/Writer classes and binary I/O using InputStream/OutputStream classes. The File class represents file and directory paths and provides methods for file manipulation and attribute checking.
This presentation will provide the information about the Linux Root File systems and its hierarchy. So any technocrate who is willing to gain info about root files of Linux can easily understand . preffered for Embedded system design Students who are pursuing diploma courses in various CDAC centers.
This document provides instructions on various commands for managing files in Linux, including touch for creating empty files, cp for copying files, mv for moving and renaming files, ln for creating hard and soft links between files, rm for deleting files, and using wildcards. It describes options for these commands like -f (force), -i (interactive), -p (preserve permissions), -R (recursive), -a (archive), and -u (update). The document is from a Linux essentials textbook and provides details on manipulating files from the command line.
This document provides instructions on various commands for managing files in Linux, including touch for creating empty files, cp for copying files, mv for moving and renaming files, ln for creating hard and soft links between files, rm for deleting files, and using wildcards. It describes options for these commands like -f (force), -i (interactive), -p (preserve permissions), -R (recursive), -a (archive), and -u (update). The document is from a Linux essentials textbook and provides details on manipulating files from the command line.
The document discusses several key aspects of processes and memory management in Linux:
1. A process is represented by a task_struct structure that contains information like the process ID, open files, address space, and state.
2. Each process has both a user stack and kernel stack. The kernel stack is fixed size for safety and to prevent fragmentation.
3. Process duplication is done through fork(), vfork(), and clone() system calls. Fork uses copy-on-write to efficiently duplicate the process.
4. Memory allocation for kernel structures like task_struct uses slab allocators to improve performance over the buddy allocator through object caching and reuse.
The document discusses several key aspects of processes and memory management in Linux:
1. A process is represented by a task_struct structure that contains information like the process ID, open files, address space, state, and stack.
2. Processes have both a user stack and a fixed-size kernel stack. Context switches occur when switching between these stacks for system calls or exceptions.
3. The fork() system call duplicates a process by using copy-on-write techniques to efficiently copy resources from the parent process.
4. Memory allocation for kernel objects like task_struct uses slab allocators to improve performance over the buddy allocator through object caching and reducing initialization overhead.
This document discusses how to organize and manipulate files in Python. It introduces the shutil module, which contains functions for copying, moving, renaming, and deleting files. It describes how to use shutil functions like copy(), copytree(), move(), rmtree() to perform common file operations. It also introduces the send2trash module as a safer alternative to permanently deleting files. Finally, it discusses walking directory trees using os.walk() to perform operations on all files within a folder and its subfolders.
This document discusses Java input and output (I/O). It covers I/O fundamentals including streams, files, and text vs binary I/O. It describes the File class for working with file paths and attributes. It also outlines the Reader, Writer, InputStream and OutputStream classes and their methods for reading and writing text and binary data to and from files and streams.
The document provides details about the system files included with Windows 98. It describes how files are compressed into CAB files and organized on the distribution disks. It explains the cabinet file structure and naming conventions. It provides information on where key system files are located after installation, including the Windows directory, boot drive, and compressed drives. It also describes the contents and functions of files included on the Windows 98 startup disk.
Problem How do you copy a file Analyze the problem and con.pdfaadeshwarexports
Problem: How do you copy a file?
Analyze the problem and consider alternate solutions:
Objective: reproduce a file.
Elements: (output) newfile, (input) oldfile
Relations: copy,reproduce, create a copy, photocopy, ...
Algorithm:
?
1
2
3
4
5
6
7
8
9
10
11
12
determine which file to copy from
find the oldfile
if cannot find oldfile, ???? else continue
determine which file to copy to
find the newfile
if newfile exists, ????? else continue
prepare (open) oldfile
prepare (open) newfile
transfer data from oldfile to newfile
put away (close) oldfile
put away (close) newfile
display the outcome
Note that our pseudocode is generic enough to follow a manual or a computerized process.
To construct a solution in the bash environment, we need to do some preparations:
1. Create a file for each script (do not get into the habit of just adding to the same file - one
solution, one file). For each variation (version), copy the current file to a file that identifies the
version. For example:
~$ mkdir bin
~$ cd bin
~/bin$ vi copy
.
.
.
~/bin$ cp copy copy.verA
~/bin$ vi copy
.
.
.
~/bin$ cp copy copy.verB
...and so on.
2. In your ~/bin directory (as demonstrated above), create a file called "copy", enter the code as
shown below, save the file and change the permissions so that you can execute the file.
~/bin$ vi copy
~/bin$ chmod 705 copy
3. Learn more about bash shell by examining the manual page: man bash
Let's return to the problem. From modelling example solutions, a number of questions should
come to mind, such as
What is a file? regular file? directory? special file?
Where do these values come from? are they chosen arbitrarily, by the user, by another program?
Identify other relevant information.
Identify and describe uncertainties about the interpretation of the problem.
Let's examine what happens to our solution as we make different assumptions about the problem
Stop and analyze:
Explore other alternatives and related assumptions.
Explore the implications of ambiguities when analysing a problem.
Consider the impact of alternative solutions on various types of users.
Plan and document how to test potential solutions.
Recognize and control your own biases when choosing a solution.
1 determine which file to copy from
2 find the oldfile
3 if cannot find oldfile, ???? else continue
4 determine which file to copy to
5 find the newfile
6 if newfile exists, ????? else continue
7 prepare (open) oldfile
8 prepare (open) newfile
9 transfer data from oldfile to newfile
10 put away (close) oldfile
11 put away (close) newfile
12 display the outcome
Version A: ....the first version is incomplete, yet provides a wealth of information that we address
one step at a time. r/bin$ copy.
Please answer all parts of the following question thoroughly.This .pdfamayagency123
Please answer all parts of the following question thoroughly.
This problem is about how the operating system finds files by name. When you give the name of
a file as an argument to a system call, the OS generally must get access to the files vnode in
order to check permissions, locate the blocks on disk that contain the files data, etc. (Recall that a
directorywhat you may think of as a folderis a list of name,vnode# pairs. All of a files metadata
is stored in its vnode.) Read the man page for path_resolution on your VM to learn about how
the OS finds the directory entry for a file. (It is relevant to Project 4.)
a) Suppose the given filename is "foo" Where would the OS look for the file?
b) What happens if you pass an empty filename, i.e., a name of length 0?
c) Recall that every directory contains an entry ".., which refers to the parent of that directory.
(The ".. entry in the root directory refers to itself. Consider:
a directory blib contains subdirectories named blab, corb, and down.
blab contains charmed, strange, and rodgers.
corb contains only foo.
down contains ork and dobbs.
Suppose the current directory is dobbs Suppose "rodgers" (in the directory "blab") is a regular
file that the program needs to open. What pathname should be passed as the first argument to the
open() system call?
d) Same as the previous part, but the current directory is "foo"?.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
How to Add Chatter in the odoo 17 ERP ModuleCeline George
In Odoo, the chatter is like a chat tool that helps you work together on records. You can leave notes and track things, making it easier to talk with your team and partners. Inside chatter, all communication history, activity, and changes will be displayed.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Smiley011
1. File Operations in Visual Basic 6
File Operations in Visual Basic 6
I'm frequently asked how to perform file operations in Visual Basic--for
instance, how to delete a file or create a directory or folder.
In this month's article, I'm going to show you five basic file type operations
using built in Visual Basic functions. These techniques are considered old
style by programmers familiar with Object Oriented programming who prefer
to use the File System Object (FSO). But a discussion of the F SO requires a
knowledge of Objects and Collections---perhaps I'll discuss FSO in a future
article, provided you promise to read my Objects book, Learn to Program
Objects with Visual Basic 6.
But back to File Operations using the built in Visual Basic functions to which I
alluded. We can categorize these operations in two ways: operations on files
and operations on directories, or the newer term, folders.
Copying Files
When you copy a file you keep the existing file, and make a copy of the file
with a new name. Visual Basic provides a statement for this called FileCopy.
Here's the syntax for the FileCopy statement
FileCopy source, destination
where source is the name of the file to copy, and destination is the name of
the copied file.
You have several choices when it comes to specifying the file names here---
you can use the full path names for the files, or you can just specify the name
of the files.
By way of background, Windows keeps track of something called the current
drive and the current directory for us---these are basically pointers in the File
System, and in the old days of DOS allowed us to perform mundane file
operations without having to specify the name of the Drive and the Directory.
These pointers still carry on in VB and Windows, so if we use this syntax in
the Click Event Procedure of a Command Button
Private Sub Command1_Click()
FileCopy "a.txt", "b.txt"
http://www.johnsmiley.com/cis18.notfree/Smiley011/Smiley011.htm (1 of 11)3/28/2004 11:47:51 AM
2. File Operations in Visual Basic 6
End Sub
Windows looks for a file called "a.txt" in the current drive and current directory
of our PC, and if the operating system finds it, copies the file as "b.txt", again
in the default drive and directory of the PC.
The problem here is that if the file is not found, your program bombs, just like
this…
The Current Drive and Current Directory
As it turns out, Visual Basic has a function that can be used to determine the
current directory called the CurDir function …
Private Sub Command2_Click()
MsgBox "The current directory is " & CurDir
End Sub
Changing the Current Drive and Current Directory
http://www.johnsmiley.com/cis18.notfree/Smiley011/Smiley011.htm (2 of 11)3/28/2004 11:47:51 AM
3. File Operations in Visual Basic 6
Once you know the current directory, you can then use the ChDir and
ChDrive functions to change either the current drive or the current directory,
like this…
Private Sub Command3_Click()
ChDrive ("d")
ChDir "vbfiles"
MsgBox "The current directory is " & CurDir
End Sub
Now if you are like me, you may not want to leave anything to chance, in
which case, you can use the full path name with the FileCopy statement, like
this…
Private Sub Command1_Click()
FileCopy "c:vbfilesa.txt", "c:vbfilesb.txt"
End Sub
I should mention that here that if you attempt to copy a file that is opened,
you'll receive this error message…
http://www.johnsmiley.com/cis18.notfree/Smiley011/Smiley011.htm (3 of 11)3/28/2004 11:47:51 AM
4. File Operations in Visual Basic 6
Does a file exist?
There's no confirmation that the copy was successful, but you can determine
if a file exists by using the Visual Basic Dir$ function. The Dir$ function
requires just a single argument representing the file name (as was the case
with the CopyFile statement, you can specify just the file name or the full path
name). If the file is found, then Dir$ returns the file name (not the full path). If
the file is not found, then Dir$ returns an empty string. Let's see how we can
use the Dir$ function to determine if a file exists before we copy it.
Private Sub Command1_Click()
Dim retval As String
retval = Dir$("c:vbfilesb.txt")
If retval = "b.txt" Then
MsgBox "b.txt exists--no need to copy it..."
Else
FileCopy "c:vbfilesa.txt", "c:vbfilesb.txt"
End If
End Sub
If we now run the program, and click on the command button…
http://www.johnsmiley.com/cis18.notfree/Smiley011/Smiley011.htm (4 of 11)3/28/2004 11:47:51 AM
5. File Operations in Visual Basic 6
We receive a message saying that the file already exists---Dir$ has done its
job.
By the way, you'll discover that there's a Dir function as well---Dir returns a
variant return value and Dir$ returns a string.
Renaming Files
Renaming files is similar to copying them--this time we use the Visual Basic
Name statement. Here's the syntax.
Name oldpathname As newpathname
As was the case when we copied files, we can choose either to specify a file
name or to include the full path name---once again, I advise the full path
name…
Private Sub Command1_Click()
Name "c:vbfilesb.txt" As "c:vbfilesnewb.txt"
End Sub
This code will result in the file 'b.txt' begin renamed to 'newb.txt'. Once again,
don't expect a confirmation message telling you that the rename was
successful--the only message you'll receive is if the file does not exist
http://www.johnsmiley.com/cis18.notfree/Smiley011/Smiley011.htm (5 of 11)3/28/2004 11:47:51 AM
6. File Operations in Visual Basic 6
Deleting Files
The final file operation I'll discuss in this article is that of deleting a file. Visual
Basic provides us with the Kill statement which will delete a file (and
dangerously, a wildcard selection of files) of our choosing. Here's the syntax…
Kill pathname
Let's say that we wish to delete the file ''newb.txt' file that we created just a
few minutes ago. This code will do the trick…
Private Sub Command1_Click()
Kill "c:vbfilesnewb.txt"
End Sub
Again, there will be no confirmation message, only an error message if the
file we are attempting to delete does not exist.
http://www.johnsmiley.com/cis18.notfree/Smiley011/Smiley011.htm (6 of 11)3/28/2004 11:47:51 AM
7. File Operations in Visual Basic 6
As I mentioned, you can also use wildcards as an argument to the Kill
statement (WARNING: Don’t attempt this at home!!!). For instance, this code
will delete EVERY file in the VBFILES directory that has a file extension of *.
txt…
Private Sub Command1_Click()
Kill "c:vbfiles*.txt"
End Sub
Most dangerously, this code will delete EVERY file in the VBFILES
directory…
Private Sub Command1_Click()
Kill "c:vbfiles*.*"
End Sub
Be careful when using the Kill statement---when issued through Visual Basic,
there's no going back. There is no Undo statement, and files deleted in this
way are NOT moved to the Windows Recycle bin.
Moving Files
There is no explicit Visual Basic statement to move a file. To simulate a move
of a file, all we need to do is combine the FileCopy and Kill statements that
we've already seen. For instance, to move the file a.txt from C:VBFILES to C:
VBILESCHINA, we can execute this code…
http://www.johnsmiley.com/cis18.notfree/Smiley011/Smiley011.htm (7 of 11)3/28/2004 11:47:51 AM
8. File Operations in Visual Basic 6
Private Sub Command1_Click()
FileCopy "c:vbfilesa.txt", "c:vbfileschinaa.txt"
Kill "c:vbfilesa.txt"
End Sub
Again, don't expect any confirmation messages---only errors if the files you
reference do not exist.
That's it for Visual Basic actions that we can take against files---now it's time
to turn our attention to Directory or folder operations.
Creating a Directory (Folder)
Creating a Folder is something that we're used to doing using Windows
Explorer, but Visual Basic gives us the capability of creating folders within our
program using the MkDir statement. Here's the syntax…
MkDir path
where path is either the name of a folder to be created, or (better yet!) the full
path name of the directory or folder that you wish to create.
Specifying just the folder name to be created can be dangerous---if you are
not aware of the current drive and directory, you may wind up creating a
folder somewhere on your hard drive, with no real idea where it went. Better
to be sure and specify the full path name, like this
Private Sub Command1_Click()
MkDir "c:vbfilessmiley"
End Sub
This code will create a folder called 'smiley' within the folder 'vbfiles' on the C
Drive. Once again, you'll receive no confirmation message if the folder is
created, but you will receive an error message if the folder creation fails.
There are two potential errors when executing the MkDir statement.
http://www.johnsmiley.com/cis18.notfree/Smiley011/Smiley011.htm (8 of 11)3/28/2004 11:47:51 AM
9. File Operations in Visual Basic 6
First, if you attempt to create a folder that already exists, you'll receive this
error message
The error message is not explicit enough for my liking, but that's what it
means---the folder 'smiley' already exists.
A second possible pitfall is attempting to create a folder within a folder that
itself does not exist. For instance, in this code
Private Sub Command1_Click()
MkDir "c:vbfilessmileyonetwo"
End Sub
if the folder 'one' does not yet exist within 'smiley', you can't create the folder
'two'--and you'll receive this error message…
http://www.johnsmiley.com/cis18.notfree/Smiley011/Smiley011.htm (9 of 11)3/28/2004 11:47:51 AM
10. File Operations in Visual Basic 6
Removing a Directory (Folder)
Removing a directory is similar to removing a file---in this case, we use the
Visual Basic RmDir statement. Here's the syntax…
RmDir path
As was the case with the MkDir statement, path can either be a file name or
the full path of a file name (once again, my recommendation). This code will
remove the folder 'smiley' that we just created …
Private Sub Command1_Click()
RmDir "c:vbfilessmiley"
End Sub
It should come as no surprise to you that there's no confirmation message
generated for a successful removal of the folder.
Possible error messages from RmDir?
There are two pitfalls. First, as we've seen all along, if you attempt to remove
a folder that does not exist, you'll receive this error message…
A second possible error can occur if you attempt to remove a directory or
folder that contains files. If you try, you'll receive this error message…
http://www.johnsmiley.com/cis18.notfree/Smiley011/Smiley011.htm (10 of 11)3/28/2004 11:47:51 AM
11. File Operations in Visual Basic 6
You must first use the Kill statement to remove every file from the folder
before executing the RmDir statement (that's where the wildcard for the Kill
statement comes in handy!)
Moving a Directory (Folder)
As was the case with moving files, there is no explicit Visual Basic statement
that will do this for you.. To move a folder (and everything along with it), you'll
first need to create the new folder, then use FileCopy to copy all of its files to
the new folder, then delete all the files in the old folder using the Kill
statement, and finally remove the old folder.
Summary
The need to work with directories (folders) and files can arise during your
Visual Basic programming career---I hope this overview of the Visual Basic
file and folder statements will help you.
As I mentioned at the beginning of the article, the File System Object (FSO)
can also be used to do everything that you've seen here--but it's available
only in Visual Basic 6, and it requires a comfort level with Objects and
Collections that you may not yet have.
If there's a demand for it, I'll be glad to address it in an upcoming article.
http://www.johnsmiley.com/cis18.notfree/Smiley011/Smiley011.htm (11 of 11)3/28/2004 11:47:51 AM