473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

IsFile and IsDirectory functions

Is there any function to detect if a valid path is a file or a directory ?
I've tried with (System.IO.Path.GetExtension(path)==""), but it doesn't
work, since some files haven't any extension and some folders have some dots
inside their path.
Any suggestions?
Nov 16 '05 #1
1 17949
You could check out File.Exists() and Directory.Exists() but I'm assuming
you mean valid files/directories already existing
"Flix" <wr***@newsgroup.comeon> wrote in message
news:cp**********@lacerta.tiscalinet.it...
Is there any function to detect if a valid path is a file or a directory ?
I've tried with (System.IO.Path.GetExtension(path)==""), but it doesn't
work, since some files haven't any extension and some folders have some dots inside their path.
Any suggestions?

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ebobnar | last post by:
I'm having trouble navigating my directory structure using php's ftp functions (such as ftp_chdir and ftp_cdup.) I'm writing a program that allows a user to easily create robot.txt files and upload...
7
by: Tim ffitch | last post by:
Hi I have created a VB dll file that contains common functions I use across various projects in VB, Access and Excel. Rather than have to code the functions in each I decided to use the dll...
7
by: C. A. Kelly | last post by:
I have a program that I want to launch links if certain criteria is met, the problem is how can I determine if a string is a program to launch, here is an example with quotes-> "c:\Program...
1
by: Gary Wessle | last post by:
Hi could someone help me to find out whats wrong with this code? **************** code **************** import os, sys if len(sys.argv) < 2: sys.exit("please enter a suitable directory.")
6
by: NickP | last post by:
Hi there, The following returns "False"... MsgBox(New Uri("ftp://me.pop.com/pop.bmp").IsFile.ToString) Is there any particular reason? It seems like a pretty poor function to me as that is...
5
by: 7stud | last post by:
Here's the code: ------------ import os, os.path, pprint mydir = "/Users/me/2testing" files = pprint.pprint(files) print os.path.join(mydir, "helloWorld.py")
10
by: ppaterson | last post by:
Can os.path.isfile(x) ever return True after os.remove(x) has successfully completed? (Windows 2003, Python 2.3) We had a couple of failures in a server application that we cannot yet reproduce...
2
by: 7stud | last post by:
Here is a program to print out the files in a directory: ----------- import os myfiles = os.listdir("../") print myfiles for afile in myfiles: print afile
7
by: Immortal Nephi | last post by:
My project grows large when I put too many member functions into one class. The header file and source code file will have approximately 50,000 lines when one class contains thousand member...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.