SlideShare a Scribd company logo
1 of 5
Download to read offline
//Tested on linux,ubuntu
#include
#include
#include
#include
#include
/*Main function start*/
int main(int argc, char *argv[])
{
/*variable for buffer*/
struct stat statbuf;
/*pointer variable declaration*/
DIR *dp;
struct dirent *dirp;
/*if we are not providing file path then it will take current directory as name*/
if(argc==1)
{
dp = opendir("./");
}
else
{
dp = opendir(argv[1]);
}
while ( (dirp=readdir(dp)) != NULL)
{
/*lstat - get symbolic link status
* Please readabout lstat more*/
lstat(dirp->d_name, &statbuf);
/*checking it is directory or not*/
if(S_ISDIR(statbuf.st_mode))
{
/*it is printing directory name with /*/
printf("%s/  ", dirp->d_name);
}
else
{
/*If it is file then we are printing only name of file*/
printf("%s ", dirp->d_name);
}
}
/*cosing directory pointer*/
closedir(dp);
exit(0);
}
/*main function end*/
/**********output**********/
gopal@gopal:~/Desktop/chegg$ gcc directory.c
gopal@gopal:~/Desktop/chegg$ ./a.out
dLinkedList.c
random.c
jasmin/
LinkedStack.cpp
VideoGame.java
LinkedStack.cpp
Client.class
web.xml
../
TemplateMain.cpp
Energy.py
PrecondViolatedExcept.h
CSA.cpp
BoxofProduce.cpp
./
Unanswere/
Tree.c
target/
readFile.c
inventory.txt
goodQuestion
interest.c
VideoGameManager.java
Thanks a lot
Solution
//Tested on linux,ubuntu
#include
#include
#include
#include
#include
/*Main function start*/
int main(int argc, char *argv[])
{
/*variable for buffer*/
struct stat statbuf;
/*pointer variable declaration*/
DIR *dp;
struct dirent *dirp;
/*if we are not providing file path then it will take current directory as name*/
if(argc==1)
{
dp = opendir("./");
}
else
{
dp = opendir(argv[1]);
}
while ( (dirp=readdir(dp)) != NULL)
{
/*lstat - get symbolic link status
* Please readabout lstat more*/
lstat(dirp->d_name, &statbuf);
/*checking it is directory or not*/
if(S_ISDIR(statbuf.st_mode))
{
/*it is printing directory name with /*/
printf("%s/  ", dirp->d_name);
}
else
{
/*If it is file then we are printing only name of file*/
printf("%s ", dirp->d_name);
}
}
/*cosing directory pointer*/
closedir(dp);
exit(0);
}
/*main function end*/
/**********output**********/
gopal@gopal:~/Desktop/chegg$ gcc directory.c
gopal@gopal:~/Desktop/chegg$ ./a.out
dLinkedList.c
random.c
jasmin/
LinkedStack.cpp
VideoGame.java
LinkedStack.cpp
Client.class
web.xml
../
TemplateMain.cpp
Energy.py
PrecondViolatedExcept.h
CSA.cpp
BoxofProduce.cpp
./
Unanswere/
Tree.c
target/
readFile.c
inventory.txt
goodQuestion
interest.c
VideoGameManager.java
Thanks a lot

More Related Content

Similar to Tested on linux,ubuntu#include stdlib.h #include systypes..pdf

[Laporan ai kelas b] 14102055 deprilana ego prakasa_modul 4
[Laporan ai kelas b] 14102055 deprilana ego prakasa_modul 4[Laporan ai kelas b] 14102055 deprilana ego prakasa_modul 4
[Laporan ai kelas b] 14102055 deprilana ego prakasa_modul 4Deprilana Ego Prakasa
 
Extending Zend Framework
Extending Zend FrameworkExtending Zend Framework
Extending Zend FrameworkPHPBelgium
 
On secure application of PHP wrappers
On secure application  of PHP wrappersOn secure application  of PHP wrappers
On secure application of PHP wrappersPositive Hack Days
 
-- This is the shell-c Test- --shell -test sub #include -ctype-h- -- C.pdf
-- This is the shell-c Test- --shell -test sub #include -ctype-h- -- C.pdf-- This is the shell-c Test- --shell -test sub #include -ctype-h- -- C.pdf
-- This is the shell-c Test- --shell -test sub #include -ctype-h- -- C.pdfAdrianEBJKingr
 
Empacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debianEmpacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debianAndre Ferraz
 
Logrotate sh
Logrotate shLogrotate sh
Logrotate shBen Pope
 
DocBlox: your source matters @ #pfc11
DocBlox: your source matters @ #pfc11DocBlox: your source matters @ #pfc11
DocBlox: your source matters @ #pfc11Mike van Riel
 
WEB PROGRAMMING UNIT VI BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VI BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VI BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VI BY BHAVSINGH MALOTHBhavsingh Maloth
 
Discover Dart(lang) - Meetup 07/12/2016
Discover Dart(lang) - Meetup 07/12/2016Discover Dart(lang) - Meetup 07/12/2016
Discover Dart(lang) - Meetup 07/12/2016Stéphane Este-Gracias
 
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntuMengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntuAlferizhy Chalter
 
file_handling_in_c.ppt
file_handling_in_c.pptfile_handling_in_c.ppt
file_handling_in_c.pptyuvrajkeshri
 
Store-Locator-Final-App-master.gitattributes# Auto detect tex.docx
Store-Locator-Final-App-master.gitattributes# Auto detect tex.docxStore-Locator-Final-App-master.gitattributes# Auto detect tex.docx
Store-Locator-Final-App-master.gitattributes# Auto detect tex.docxdessiechisomjj4
 

Similar to Tested on linux,ubuntu#include stdlib.h #include systypes..pdf (20)

Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
Unix tips and tricks
Unix tips and tricksUnix tips and tricks
Unix tips and tricks
 
[Laporan ai kelas b] 14102055 deprilana ego prakasa_modul 4
[Laporan ai kelas b] 14102055 deprilana ego prakasa_modul 4[Laporan ai kelas b] 14102055 deprilana ego prakasa_modul 4
[Laporan ai kelas b] 14102055 deprilana ego prakasa_modul 4
 
Extending Zend Framework
Extending Zend FrameworkExtending Zend Framework
Extending Zend Framework
 
On secure application of PHP wrappers
On secure application  of PHP wrappersOn secure application  of PHP wrappers
On secure application of PHP wrappers
 
-- This is the shell-c Test- --shell -test sub #include -ctype-h- -- C.pdf
-- This is the shell-c Test- --shell -test sub #include -ctype-h- -- C.pdf-- This is the shell-c Test- --shell -test sub #include -ctype-h- -- C.pdf
-- This is the shell-c Test- --shell -test sub #include -ctype-h- -- C.pdf
 
Empacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debianEmpacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debian
 
Logrotate sh
Logrotate shLogrotate sh
Logrotate sh
 
Txjs
TxjsTxjs
Txjs
 
DocBlox: your source matters @ #pfc11
DocBlox: your source matters @ #pfc11DocBlox: your source matters @ #pfc11
DocBlox: your source matters @ #pfc11
 
WEB PROGRAMMING UNIT VI BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VI BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VI BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VI BY BHAVSINGH MALOTH
 
Discover Dart(lang) - Meetup 07/12/2016
Discover Dart(lang) - Meetup 07/12/2016Discover Dart(lang) - Meetup 07/12/2016
Discover Dart(lang) - Meetup 07/12/2016
 
Discover Dart - Meetup 15/02/2017
Discover Dart - Meetup 15/02/2017Discover Dart - Meetup 15/02/2017
Discover Dart - Meetup 15/02/2017
 
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntuMengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
 
Samba 4 - debian instalacao
Samba 4 - debian instalacaoSamba 4 - debian instalacao
Samba 4 - debian instalacao
 
file_handling_in_c.ppt
file_handling_in_c.pptfile_handling_in_c.ppt
file_handling_in_c.ppt
 
Linux Commands.pptx
Linux Commands.pptxLinux Commands.pptx
Linux Commands.pptx
 
Store-Locator-Final-App-master.gitattributes# Auto detect tex.docx
Store-Locator-Final-App-master.gitattributes# Auto detect tex.docxStore-Locator-Final-App-master.gitattributes# Auto detect tex.docx
Store-Locator-Final-App-master.gitattributes# Auto detect tex.docx
 
Plpgsql internals
Plpgsql internalsPlpgsql internals
Plpgsql internals
 
Sysprog 16
Sysprog 16Sysprog 16
Sysprog 16
 

More from amaresh6333

a) It is given E is the event of getting 2. We can observe that 2 is.pdf
a) It is given E is the event of getting 2. We can observe that 2 is.pdfa) It is given E is the event of getting 2. We can observe that 2 is.pdf
a) It is given E is the event of getting 2. We can observe that 2 is.pdfamaresh6333
 
4.1 (a) SoftwoodsThese generally come from the gymnosperm trees wh.pdf
4.1 (a) SoftwoodsThese generally come from the gymnosperm trees wh.pdf4.1 (a) SoftwoodsThese generally come from the gymnosperm trees wh.pdf
4.1 (a) SoftwoodsThese generally come from the gymnosperm trees wh.pdfamaresh6333
 
A special type of IP address is the limited broadcast address 255.25.pdf
A special type of IP address is the limited broadcast address 255.25.pdfA special type of IP address is the limited broadcast address 255.25.pdf
A special type of IP address is the limited broadcast address 255.25.pdfamaresh6333
 
10 leading causes of death in the United States In the recent sta.pdf
10 leading causes of death in the United States In the recent sta.pdf10 leading causes of death in the United States In the recent sta.pdf
10 leading causes of death in the United States In the recent sta.pdfamaresh6333
 
C Program to shuffle a given Aay#include stdio.h #include .pdf
 C Program to shuffle a given Aay#include stdio.h #include .pdf C Program to shuffle a given Aay#include stdio.h #include .pdf
C Program to shuffle a given Aay#include stdio.h #include .pdfamaresh6333
 
1.Router 1.It is a machine which aheads datagrams over the networks.pdf
1.Router 1.It is a machine which aheads datagrams over the networks.pdf1.Router 1.It is a machine which aheads datagrams over the networks.pdf
1.Router 1.It is a machine which aheads datagrams over the networks.pdfamaresh6333
 
1) List currently running jobsANS) see currently runningcommand.pdf
1) List currently running jobsANS) see currently runningcommand.pdf1) List currently running jobsANS) see currently runningcommand.pdf
1) List currently running jobsANS) see currently runningcommand.pdfamaresh6333
 
Step1 Total pressure = partial pressure of Hydrog.pdf
                     Step1 Total pressure = partial pressure of Hydrog.pdf                     Step1 Total pressure = partial pressure of Hydrog.pdf
Step1 Total pressure = partial pressure of Hydrog.pdfamaresh6333
 
I would say very many elements exista as monoatom.pdf
                     I would say very many elements exista as monoatom.pdf                     I would say very many elements exista as monoatom.pdf
I would say very many elements exista as monoatom.pdfamaresh6333
 
E is simply hexane...no polarity at all...nothing.pdf
                     E is simply hexane...no polarity at all...nothing.pdf                     E is simply hexane...no polarity at all...nothing.pdf
E is simply hexane...no polarity at all...nothing.pdfamaresh6333
 
Ferroxyl contains the chemical compound Potassium.pdf
                     Ferroxyl contains the chemical compound Potassium.pdf                     Ferroxyl contains the chemical compound Potassium.pdf
Ferroxyl contains the chemical compound Potassium.pdfamaresh6333
 
There are two different types of mechanisms. Ther.pdf
                     There are two different types of mechanisms. Ther.pdf                     There are two different types of mechanisms. Ther.pdf
There are two different types of mechanisms. Ther.pdfamaresh6333
 
What must be true about a set of data when its standard deviation is.pdf
What must be true about a set of data when its standard deviation is.pdfWhat must be true about a set of data when its standard deviation is.pdf
What must be true about a set of data when its standard deviation is.pdfamaresh6333
 
When one drives from sea level to trailhead in high Sierras, altitud.pdf
When one drives from sea level to trailhead in high Sierras, altitud.pdfWhen one drives from sea level to trailhead in high Sierras, altitud.pdf
When one drives from sea level to trailhead in high Sierras, altitud.pdfamaresh6333
 
the reaction as follows- 14N7 + 0n1 -- 4He2 + 1.pdf
                     the reaction as follows- 14N7 + 0n1 -- 4He2 + 1.pdf                     the reaction as follows- 14N7 + 0n1 -- 4He2 + 1.pdf
the reaction as follows- 14N7 + 0n1 -- 4He2 + 1.pdfamaresh6333
 
The important thing here is to understand the Standard Electrode Pot.pdf
The important thing here is to understand the Standard Electrode Pot.pdfThe important thing here is to understand the Standard Electrode Pot.pdf
The important thing here is to understand the Standard Electrode Pot.pdfamaresh6333
 
The pathway would be overactive.The GTPase activity of the alpha s.pdf
The pathway would be overactive.The GTPase activity of the alpha s.pdfThe pathway would be overactive.The GTPase activity of the alpha s.pdf
The pathway would be overactive.The GTPase activity of the alpha s.pdfamaresh6333
 
The metal ion is Pb2+.The white precipitate PbCl2 is insoluble in .pdf
The metal ion is Pb2+.The white precipitate PbCl2 is insoluble in .pdfThe metal ion is Pb2+.The white precipitate PbCl2 is insoluble in .pdf
The metal ion is Pb2+.The white precipitate PbCl2 is insoluble in .pdfamaresh6333
 
The electron carriers that feed into the ETC are NADH and FADH2.NA.pdf
The electron carriers that feed into the ETC are NADH and FADH2.NA.pdfThe electron carriers that feed into the ETC are NADH and FADH2.NA.pdf
The electron carriers that feed into the ETC are NADH and FADH2.NA.pdfamaresh6333
 
The developmental potential, or potency of a cell, describes the ran.pdf
The developmental potential, or potency of a cell, describes the ran.pdfThe developmental potential, or potency of a cell, describes the ran.pdf
The developmental potential, or potency of a cell, describes the ran.pdfamaresh6333
 

More from amaresh6333 (20)

a) It is given E is the event of getting 2. We can observe that 2 is.pdf
a) It is given E is the event of getting 2. We can observe that 2 is.pdfa) It is given E is the event of getting 2. We can observe that 2 is.pdf
a) It is given E is the event of getting 2. We can observe that 2 is.pdf
 
4.1 (a) SoftwoodsThese generally come from the gymnosperm trees wh.pdf
4.1 (a) SoftwoodsThese generally come from the gymnosperm trees wh.pdf4.1 (a) SoftwoodsThese generally come from the gymnosperm trees wh.pdf
4.1 (a) SoftwoodsThese generally come from the gymnosperm trees wh.pdf
 
A special type of IP address is the limited broadcast address 255.25.pdf
A special type of IP address is the limited broadcast address 255.25.pdfA special type of IP address is the limited broadcast address 255.25.pdf
A special type of IP address is the limited broadcast address 255.25.pdf
 
10 leading causes of death in the United States In the recent sta.pdf
10 leading causes of death in the United States In the recent sta.pdf10 leading causes of death in the United States In the recent sta.pdf
10 leading causes of death in the United States In the recent sta.pdf
 
C Program to shuffle a given Aay#include stdio.h #include .pdf
 C Program to shuffle a given Aay#include stdio.h #include .pdf C Program to shuffle a given Aay#include stdio.h #include .pdf
C Program to shuffle a given Aay#include stdio.h #include .pdf
 
1.Router 1.It is a machine which aheads datagrams over the networks.pdf
1.Router 1.It is a machine which aheads datagrams over the networks.pdf1.Router 1.It is a machine which aheads datagrams over the networks.pdf
1.Router 1.It is a machine which aheads datagrams over the networks.pdf
 
1) List currently running jobsANS) see currently runningcommand.pdf
1) List currently running jobsANS) see currently runningcommand.pdf1) List currently running jobsANS) see currently runningcommand.pdf
1) List currently running jobsANS) see currently runningcommand.pdf
 
Step1 Total pressure = partial pressure of Hydrog.pdf
                     Step1 Total pressure = partial pressure of Hydrog.pdf                     Step1 Total pressure = partial pressure of Hydrog.pdf
Step1 Total pressure = partial pressure of Hydrog.pdf
 
I would say very many elements exista as monoatom.pdf
                     I would say very many elements exista as monoatom.pdf                     I would say very many elements exista as monoatom.pdf
I would say very many elements exista as monoatom.pdf
 
E is simply hexane...no polarity at all...nothing.pdf
                     E is simply hexane...no polarity at all...nothing.pdf                     E is simply hexane...no polarity at all...nothing.pdf
E is simply hexane...no polarity at all...nothing.pdf
 
Ferroxyl contains the chemical compound Potassium.pdf
                     Ferroxyl contains the chemical compound Potassium.pdf                     Ferroxyl contains the chemical compound Potassium.pdf
Ferroxyl contains the chemical compound Potassium.pdf
 
There are two different types of mechanisms. Ther.pdf
                     There are two different types of mechanisms. Ther.pdf                     There are two different types of mechanisms. Ther.pdf
There are two different types of mechanisms. Ther.pdf
 
What must be true about a set of data when its standard deviation is.pdf
What must be true about a set of data when its standard deviation is.pdfWhat must be true about a set of data when its standard deviation is.pdf
What must be true about a set of data when its standard deviation is.pdf
 
When one drives from sea level to trailhead in high Sierras, altitud.pdf
When one drives from sea level to trailhead in high Sierras, altitud.pdfWhen one drives from sea level to trailhead in high Sierras, altitud.pdf
When one drives from sea level to trailhead in high Sierras, altitud.pdf
 
the reaction as follows- 14N7 + 0n1 -- 4He2 + 1.pdf
                     the reaction as follows- 14N7 + 0n1 -- 4He2 + 1.pdf                     the reaction as follows- 14N7 + 0n1 -- 4He2 + 1.pdf
the reaction as follows- 14N7 + 0n1 -- 4He2 + 1.pdf
 
The important thing here is to understand the Standard Electrode Pot.pdf
The important thing here is to understand the Standard Electrode Pot.pdfThe important thing here is to understand the Standard Electrode Pot.pdf
The important thing here is to understand the Standard Electrode Pot.pdf
 
The pathway would be overactive.The GTPase activity of the alpha s.pdf
The pathway would be overactive.The GTPase activity of the alpha s.pdfThe pathway would be overactive.The GTPase activity of the alpha s.pdf
The pathway would be overactive.The GTPase activity of the alpha s.pdf
 
The metal ion is Pb2+.The white precipitate PbCl2 is insoluble in .pdf
The metal ion is Pb2+.The white precipitate PbCl2 is insoluble in .pdfThe metal ion is Pb2+.The white precipitate PbCl2 is insoluble in .pdf
The metal ion is Pb2+.The white precipitate PbCl2 is insoluble in .pdf
 
The electron carriers that feed into the ETC are NADH and FADH2.NA.pdf
The electron carriers that feed into the ETC are NADH and FADH2.NA.pdfThe electron carriers that feed into the ETC are NADH and FADH2.NA.pdf
The electron carriers that feed into the ETC are NADH and FADH2.NA.pdf
 
The developmental potential, or potency of a cell, describes the ran.pdf
The developmental potential, or potency of a cell, describes the ran.pdfThe developmental potential, or potency of a cell, describes the ran.pdf
The developmental potential, or potency of a cell, describes the ran.pdf
 

Recently uploaded

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

Tested on linux,ubuntu#include stdlib.h #include systypes..pdf

  • 1. //Tested on linux,ubuntu #include #include #include #include #include /*Main function start*/ int main(int argc, char *argv[]) { /*variable for buffer*/ struct stat statbuf; /*pointer variable declaration*/ DIR *dp; struct dirent *dirp; /*if we are not providing file path then it will take current directory as name*/ if(argc==1) { dp = opendir("./"); } else { dp = opendir(argv[1]); } while ( (dirp=readdir(dp)) != NULL) { /*lstat - get symbolic link status * Please readabout lstat more*/ lstat(dirp->d_name, &statbuf); /*checking it is directory or not*/ if(S_ISDIR(statbuf.st_mode)) { /*it is printing directory name with /*/ printf("%s/ ", dirp->d_name); } else
  • 2. { /*If it is file then we are printing only name of file*/ printf("%s ", dirp->d_name); } } /*cosing directory pointer*/ closedir(dp); exit(0); } /*main function end*/ /**********output**********/ gopal@gopal:~/Desktop/chegg$ gcc directory.c gopal@gopal:~/Desktop/chegg$ ./a.out dLinkedList.c random.c jasmin/ LinkedStack.cpp VideoGame.java LinkedStack.cpp Client.class web.xml ../ TemplateMain.cpp Energy.py PrecondViolatedExcept.h CSA.cpp BoxofProduce.cpp ./ Unanswere/ Tree.c target/ readFile.c inventory.txt goodQuestion interest.c
  • 3. VideoGameManager.java Thanks a lot Solution //Tested on linux,ubuntu #include #include #include #include #include /*Main function start*/ int main(int argc, char *argv[]) { /*variable for buffer*/ struct stat statbuf; /*pointer variable declaration*/ DIR *dp; struct dirent *dirp; /*if we are not providing file path then it will take current directory as name*/ if(argc==1) { dp = opendir("./"); } else { dp = opendir(argv[1]); } while ( (dirp=readdir(dp)) != NULL) { /*lstat - get symbolic link status * Please readabout lstat more*/ lstat(dirp->d_name, &statbuf); /*checking it is directory or not*/ if(S_ISDIR(statbuf.st_mode)) {
  • 4. /*it is printing directory name with /*/ printf("%s/ ", dirp->d_name); } else { /*If it is file then we are printing only name of file*/ printf("%s ", dirp->d_name); } } /*cosing directory pointer*/ closedir(dp); exit(0); } /*main function end*/ /**********output**********/ gopal@gopal:~/Desktop/chegg$ gcc directory.c gopal@gopal:~/Desktop/chegg$ ./a.out dLinkedList.c random.c jasmin/ LinkedStack.cpp VideoGame.java LinkedStack.cpp Client.class web.xml ../ TemplateMain.cpp Energy.py PrecondViolatedExcept.h CSA.cpp BoxofProduce.cpp ./ Unanswere/ Tree.c target/